Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger *logrus.Logger
Logger is the global logger.
Functions ¶
func Init ¶
func Init(cfg *LoggerConfig)
Types ¶
type ConfigOption ¶
ConfigOption is a function to set logger config.
type FormatOption ¶
type FormatOption func(f *formatter)
FormatOption is a function to set formatter config.
func SetLogPattern ¶
func SetLogPattern(logPattern string) FormatOption
Put the log pattern in formatter.
func SetTimePattern ¶
func SetTimePattern(timePattern string) FormatOption
Put the time pattern in formatter.
type LoggerConfig ¶
type LoggerConfig struct {
LogPattern string `mapstructure:"log_pattern"`
TimePattern string `mapstructure:"time_pattern"`
Level string `mapstructure:"level"`
}
LoggerConfig initializes the global logger config.
Click to show internal directories.
Click to hide internal directories.