Documentation ¶
Overview ¶
Package log provides logging functions and middleware
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaults ¶
func SetDefaults(d LoggerOptions)
SetDefaults will set the logger options used when creating a default logger
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a logging handler instance.
func Default ¶
func Default() *Logger
Default returns a logger instance using the configured defaults.
func FromContext ¶
FromContext returns the logger instance from a context If the logger is unset, a default logger is returned
func (*Logger) DebugEnabled ¶
DebugEnabled checks if Debug level logging is enabled
func (*Logger) Error ¶
Error logs at level ERROR. If the error arg is non-nil, it will be appended to the attributes under key "err"
func (*Logger) WithString ¶
WithString adds a string valued attribute to the logger context. All logs produced with this logger will include the new attribute.
type LoggerOptions ¶
LoggerOptions provide the options for customizing the behavior New Logger instances.