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 ¶ added in v0.0.2
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 ¶ added in v0.0.2
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.
func (*Backend) Log ¶ added in v0.0.2
Log is used to log a message as per the logging.Backend interface.
func (*Backend) Rotate ¶ added in v0.0.2
Rotate simply reopens the log file for writing and should be used to implement log rotation where this is invoked upon HUP signal for example.