Documentation ¶
Overview ¶
Package log configures a new logger for an application.
Index ¶
- func ConfigureLoggingFlags(v *viper.Viper, p *pflag.FlagSet)
- func NewErrorStandardLogger(logger logur.Logger) *log.Logger
- func NewLogger(config Config) logur.Logger
- func SetStandardLogger(logger logur.Logger)
- func WithFields(logger logur.Logger, fields map[string]interface{}) logur.Logger
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErrorStandardLogger ¶
NewErrorStandardLogger returns a new standard logger logging on error level.
func SetStandardLogger ¶
SetStandardLogger sets the global logger's output to a custom logger instance.
Types ¶
type Config ¶
type Config struct { // Format specifies the output log format. // Accepted values are: json, logfmt Format string `json:"format,omitempty" mapstructure:"format"` // Level is the minimum log level that should appear on the output. Level string `json:"level,omitempty" mapstructure:"level"` // NoColor makes sure that no log output gets colorized. NoColor bool `json:"noColor,omitempty" mapstructure:"noColor"` }
Config holds details necessary for logging.
Click to show internal directories.
Click to hide internal directories.