Documentation
¶
Overview ¶
Package log provides a logging backend, based around the go-logging package.
Index ¶
- type Backend
- func (b *Backend) GetGoLogger(module string, level string) *goLog.Logger
- func (b *Backend) GetLevel(level string) logging.Level
- func (b *Backend) GetLogWriter(module string, level string) io.Writer
- func (b *Backend) GetLogger(module string) *logging.Logger
- func (b *Backend) IsEnabledFor(level logging.Level, module string) bool
- func (b *Backend) Log(level logging.Level, calldepth int, record *logging.Record) error
- func (b *Backend) Rotate() error
- func (b *Backend) SetLevel(level logging.Level, module string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { logging.LeveledBackend sync.RWMutex // contains filtered or unexported fields }
Backend is a log backend.
func (*Backend) GetGoLogger ¶
GetGoLogger returns a per-module Go runtime *log.Logger that writes to the backend. Due to limitations of the Go runtime log package, only one level is supported per returned Logger.
func (*Backend) GetLevel ¶
GetLevel returns the logging level for the specified module as per the logging.Leveled interface.
func (*Backend) GetLogWriter ¶
GetLogWriter returns a per-module io.Writer that writes to the backend at the provided level.
func (*Backend) IsEnabledFor ¶
IsEnabledFor returns true if the logger is enabled for the given level. We use this function as part of our implementation of the logging.Leveled interface.