Documentation
¶
Index ¶
Constants ¶
View Source
const LoggerKey loggerKey = "logger"
LoggerKey is the key to access the logger in context
Variables ¶
View Source
var ErrLoggerNotFoundInContext = errors.New("Logger not found in context")
ErrLoggerNotFoundInContext is the error when calling MustFromContext and the logger is not found
Functions ¶
Types ¶
type Logger ¶
Logger is a generic Logger interface
func FromContext ¶
FromContext gets the logger from context. If context does not exist, it returns nil.
func MustFromContext ¶
MustFromContext gets the logger from context. If context does not exist, it panics with a ErrLoggerNotFoundInContext.
Click to show internal directories.
Click to hide internal directories.