Documentation
¶
Index ¶
Constants ¶
View Source
const ( Debug string = "DEBUG" Info string = "INFO" Warning string = "WARNING" Error string = "ERROR" )
Log levels.
Variables ¶
View Source
var DefaultConfig = Config{ Enabled: true, Level: Info, Caller: true, Development: true, }
DefaultConfig for logging.
Functions ¶
func SetupWithConfig ¶
func SetupWithConfig(config *Config)
SetupWithConfig updates the logger with the given config.
Types ¶
type Config ¶
type Config struct { Enabled bool `mapstructure:"enabled"` Level string `mapstructure:"level"` Caller bool `mapstructure:"caller"` Development bool `mapstructure:"development"` Output string `mapstructure:"output"` Name string `mapstructure:"name"` }
Config represents the logging config.
type Logger ¶
type Logger struct { *zap.SugaredLogger // contains filtered or unexported fields }
Logger wraps zap.SugaredLogger to allow updating all the loggers.
func (*Logger) ErrorStackTrace ¶
ErrorStackTrace prints the stack trace present in the error type.
func (*Logger) WarnStackTrace ¶
WarnStackTrace prints the stack trace present in the error type as warning log.
Click to show internal directories.
Click to hide internal directories.