Documentation ¶
Overview ¶
Package log provides logging abstractions.
Index ¶
- func Debug(args ...interface{})
- func Debugf(msg string, args ...interface{})
- func Enabled(l Level) bool
- func Error(args ...interface{})
- func Errorf(msg string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(msg string, args ...interface{})
- func Info(args ...interface{})
- func Infof(msg string, args ...interface{})
- func LevelOrder(lvl Level) int
- func Panic(args ...interface{})
- func Panicf(msg string, args ...interface{})
- func Setup(l Logger) error
- func Warn(args ...interface{})
- func Warnf(msg string, args ...interface{})
- func WithContext(ctx context.Context, l Logger) context.Context
- type Level
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LevelOrder ¶ added in v0.46.0
LevelOrder returns the numerical order of the level.
Types ¶
type Level ¶
type Level string
The Level type definition.
const ( // DebugLevel level. DebugLevel Level = "debug" // InfoLevel level. InfoLevel Level = "info" // WarnLevel level. WarnLevel Level = "warn" // ErrorLevel level. ErrorLevel Level = "error" // FatalLevel level. FatalLevel Level = "fatal" // PanicLevel level. PanicLevel Level = "panic" // NoLevel level. NoLevel Level = "" )
type Logger ¶
type Logger interface { Sub(map[string]interface{}) Logger Fatal(...interface{}) Fatalf(string, ...interface{}) Panic(...interface{}) Panicf(string, ...interface{}) Error(...interface{}) Errorf(string, ...interface{}) Warn(...interface{}) Warnf(string, ...interface{}) Info(...interface{}) Infof(string, ...interface{}) Debug(...interface{}) Debugf(string, ...interface{}) Level() Level }
Logger interface definition of a logger.
func FromContext ¶ added in v0.23.0
FromContext returns the logger in the context or a nil logger.
Directories ¶
Path | Synopsis |
---|---|
Package std is the implementation of the logger interface with the standard log package.
|
Package std is the implementation of the logger interface with the standard log package. |
Package zerolog is a concrete implementation of the log abstractions.
|
Package zerolog is a concrete implementation of the log abstractions. |
Click to show internal directories.
Click to hide internal directories.