Documentation ¶
Index ¶
- Variables
- func DPanic(args ...interface{})
- func DPanicf(template string, args ...interface{})
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func InitLogger(logger *LoggerConfig)
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- type LoggerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger *zap.SugaredLogger
the backend logger
Functions ¶
func DPanicf ¶
func DPanicf(template string, args ...interface{})
but if panic make a formatted string
Types ¶
type LoggerConfig ¶
type LoggerConfig struct { FileName string `mapstructure:"path"` // filepath Size int `mapstructure:"max"` // maximum size of file in megabyte Backups int `mapstructure:"backups"` // number of backup files Age int `mapstructure:"age"` // age of a file in days Compress bool `mapstructure:"compress"` // compress the files Level string `mapstructure:"level"` // set the log level default is error }
configure the logging
var LoggingConfig *LoggerConfig
global logger configuration
func InitLoggerConfig ¶
func InitLoggerConfig(filepath, loglevel string, sizeoffile, numberofbackups, ageoffile int, compress bool) *LoggerConfig
build a logger configuration
Click to show internal directories.
Click to hide internal directories.