Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Level is the minimum record level to log. Either 'debug', 'info', 'warn' // or 'error'. Level string `json:"level" yaml:"level"` // Subsystems enables debug logging on log records whose 'subsystem' // matches one of the given values (overrides `Level`). Subsystems []string `json:"subsystems" yaml:"subsystems"` }
func (*Config) RegisterFlags ¶
type Logger ¶
type Logger interface { Subsystem() string // WithSubsystem creates a new logger with the given subsystem. WithSubsystem(s string) Logger With(fields ...zap.Field) Logger Debug(msg string, fields ...zap.Field) Info(msg string, fields ...zap.Field) Warn(msg string, fields ...zap.Field) Error(msg string, fields ...zap.Field) Sync() error // StdLogger returns a standard library log.Logger that logs records using // with the given level. StdLogger(level zapcore.Level) *stdlog.Logger }
Logger is a logger which writes structured logs to stderr formatted as JSON.
Logs can be filtered by level, where only logs whose level exceeds the configured minimum level are logged. The log level can be overridden to include all logs matching the enabled subsystems.
Logger is a simplified zap.Logger (which uses zapcore). zap.Logger had to be reimplemented to support overriding the log level filter.
func NewLogger ¶
NewLogger creates a new logger filtering using the given log level and enabled subsystems.
func NewNopLogger ¶
func NewNopLogger() Logger
Click to show internal directories.
Click to hide internal directories.