Documentation ¶
Overview ¶
Package log implements support for structured logging.
Index ¶
- func WriterIntoLogger(l Logger) io.Writer
- type Format
- type Level
- type Logger
- func (l *Logger) Debug(msg string, keyvals ...interface{})
- func (l *Logger) Error(msg string, keyvals ...interface{})
- func (l *Logger) Info(msg string, keyvals ...interface{})
- func (l *Logger) Level() Level
- func (l *Logger) Warn(msg string, keyvals ...interface{})
- func (l *Logger) With(keyvals ...interface{}) *Logger
- func (l *Logger) WithCallerUnwind(n int) *Logger
- func (l *Logger) WithModule(module string) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriterIntoLogger ¶ added in v0.2.8
Types ¶
type Format ¶
type Format uint
Format is a logging format. It implements the pflag.Value interface.
type Level ¶
type Level uint
Level is a log level. It implements the pflag.Value interface.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a structured logger.
func NewDefaultLogger ¶
NewDefaultLogger initializes a new logger instance with default settings. For usage outside tests, prefer RootLogger() from package `cmd/common`.
func (*Logger) With ¶
With returns a clone of the logger with the provided key/value pairs added as context for all subsequent logs.
func (*Logger) WithCallerUnwind ¶ added in v0.2.8
WithCallerUnwind returns a clone of the logger where the `caller` value will show the n-th entry on the call stack at the time of logging.
func (*Logger) WithModule ¶
WithModule returns a clone of the logger with the provided module added as context for all subsequent logs.