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 IncreaseDebugCounter()
- func IncreaseErrorCounter()
- func IncreaseFatalCounter()
- func IncreaseInfoCounter()
- func IncreasePanicCounter()
- func IncreaseWarnCounter()
- func Info(args ...interface{})
- func Infof(msg string, args ...interface{})
- func LevelCount(level string) prometheus.Counter
- func LevelOrder(lvl Level) int
- func Panic(args ...interface{})
- func Panicf(msg string, args ...interface{})
- func ResetLogCounter()
- 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 IncreaseDebugCounter ¶ added in v0.71.0
func IncreaseDebugCounter()
IncreaseDebugCounter increases the debug counter.
func IncreaseErrorCounter ¶ added in v0.71.0
func IncreaseErrorCounter()
IncreaseErrorCounter increases the error counter.
func IncreaseFatalCounter ¶ added in v0.71.0
func IncreaseFatalCounter()
IncreaseFatalCounter increases the fatal counter.
func IncreaseInfoCounter ¶ added in v0.71.0
func IncreaseInfoCounter()
IncreaseInfoCounter increases the info counter.
func IncreasePanicCounter ¶ added in v0.71.0
func IncreasePanicCounter()
IncreasePanicCounter increases the panic counter.
func IncreaseWarnCounter ¶ added in v0.71.0
func IncreaseWarnCounter()
IncreaseWarnCounter increases the warn counter.
func LevelCount ¶ added in v0.71.0
func LevelCount(level string) prometheus.Counter
LevelCount returns the total level count.
func LevelOrder ¶ added in v0.46.0
LevelOrder returns the numerical order of the level.
func ResetLogCounter ¶ added in v0.71.0
func ResetLogCounter()
ResetLogCounter resets the log counter.
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.