Documentation
¶
Overview ¶
Package logging defines a very simple logger interface conforming with logging best practices and Clean Architecture. It's especially useful as a standardized logger for microservices and libraries.
Index ¶
- func Named(name string, logger Logger) named
- type Logger
- type Noop
- func (n Noop) Debug(...interface{})
- func (n Noop) Debugf(string, ...interface{})
- func (n Noop) Debugw(string, ...interface{})
- func (n Noop) Error(...interface{})
- func (n Noop) Errorf(string, ...interface{})
- func (n Noop) Errorw(string, ...interface{})
- func (n Noop) Info(...interface{})
- func (n Noop) Infof(string, ...interface{})
- func (n Noop) Infow(string, ...interface{})
- func (n Noop) Warn(...interface{})
- func (n Noop) Warnf(string, ...interface{})
- func (n Noop) Warnw(string, ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
Debug(v ...interface{})
Info(v ...interface{})
Warn(v ...interface{})
Error(v ...interface{})
Debugf(format string, v ...interface{})
Infof(format string, v ...interface{})
Warnf(format string, v ...interface{})
Errorf(format string, v ...interface{})
Debugw(msg string, keysAndValues ...interface{})
Infow(msg string, keysAndValues ...interface{})
Warnw(msg string, keysAndValues ...interface{})
Errorw(msg string, keysAndValues ...interface{})
}
Logger defines a logger with 4 levels: Debug, Info, Warn and Error. All of them have 3 types of functions: simple, according to a format and with key-value pairs.
Click to show internal directories.
Click to hide internal directories.