Documentation ¶
Overview ¶
Package log implements support for structured logging.
Index ¶
- 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) WithModule(module string) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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.
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) WithModule ¶
WithModule returns a clone of the logger with the provided module added as context for all subsequent logs.
Click to show internal directories.
Click to hide internal directories.