Documentation ¶
Overview ¶
Package logger provides context-aware and structured logging capabilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { // With returns a logger based off the root logger and decorates it with the given arguments. With(args ...interface{}) Logger // Debug uses fmt.Sprint to construct and log a message at DEBUG level Debug(args ...interface{}) // Info uses fmt.Sprint to construct and log a message at INFO level Info(args ...interface{}) // Error uses fmt.Sprint to construct and log a message at ERROR level Error(args ...interface{}) // Debugf uses fmt.Sprintf to construct and log a message at DEBUG level Debugf(format string, args ...interface{}) // Infof uses fmt.Sprintf to construct and log a message at INFO level Infof(format string, args ...interface{}) // Errorf uses fmt.Sprintf to construct and log a message at ERROR level Errorf(format string, args ...interface{}) // Debugw logs a message with some additional context Debugw(msg string, keysAndValues ...interface{}) // Infow logs a message with some additional context Infow(msg string, keysAndValues ...interface{}) // Errorw logs a message with some additional context Errorw(msg string, keysAndValues ...interface{}) }
Logger is a logger that supports log levels, context and structured logging.
func NewForTest ¶
func NewForTest() (Logger, *observer.ObservedLogs)
NewForTest returns a new logger and the corresponding observed logs which can be used in unit tests to verify log entries.
func NewWithZap ¶
NewWithZap creates a new logger using the pre-configured zap logger.
Click to show internal directories.
Click to hide internal directories.