Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultLoggingLevel ¶
func DefaultLoggingLevel() logging.Level
DefaultLoggingLevel returns the fallback value for loggers to use if parsing fails
func LoggingFileInit ¶
func LoggingInit ¶
func LoggingInit(command string)
LoggingInit is a 'hook' called at the beginning of command processing to parse logging-related options specified either on the command-line or in config files. Command-line options take precedence over config file options, and can also be passed as suitably-named environment variables. To change module logging levels at runtime call `logging.SetLevel(level, module)`. To debug this routine include logging=debug as the first term of the logging specification.
func SetLogFormat ¶
Types ¶
type FileLogBackend ¶
type FileLogBackend struct { Logger *log.Logger sync.Mutex // contains filtered or unexported fields }
LogBackend utilizes the standard log module.
func NewFileLogBackend ¶
func NewFileLogBackend(filePath string, prefix string, flag int, flushLevel logging.Level, syncLevel logging.Level) (*FileLogBackend, error)
func (*FileLogBackend) Log ¶
func (b *FileLogBackend) Log(level logging.Level, calldepth int, rec *logging.Record) error
Log implements the Backend interface.
type GoRoutineIDPrinter ¶
type GoRoutineIDPrinter int
var GoRDef GoRoutineIDPrinter = 0
func (GoRoutineIDPrinter) String ¶
func (base GoRoutineIDPrinter) String() string
type ModuleLeveled ¶
type ModuleLeveled struct { logging.Backend // contains filtered or unexported fields }
var (
DefaultBackend *ModuleLeveled
)
func DuplicateLevelBackend ¶
func DuplicateLevelBackend(backend logging.Backend) *ModuleLeveled
duplicate from the default one and replace with another backend
func (*ModuleLeveled) GetLevel ¶
func (l *ModuleLeveled) GetLevel(module string) logging.Level
GetLevel returns the log level for the given module.
func (*ModuleLeveled) IsEnabledFor ¶
func (l *ModuleLeveled) IsEnabledFor(level logging.Level, module string) bool
IsEnabledFor will return true if logging is enabled for the given module.
func (*ModuleLeveled) Log ¶
func (l *ModuleLeveled) Log(level logging.Level, calldepth int, rec *logging.Record) error
func (*ModuleLeveled) SetLevel ¶
func (l *ModuleLeveled) SetLevel(level logging.Level, module string)
SetLevel sets the log level for the given module.