Documentation
¶
Index ¶
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warnln(args ...interface{})
- type LogInfo
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogInfo ¶
type LogInfo struct {
Path string `yaml:"path" json:"path"`
Level string `yaml:"level" json:"level" default:"info" validate:"regexp=^(info|debug|warn|error)$"`
Format string `yaml:"format" json:"format" default:"text" validate:"regexp=^(text|json)$"`
Age struct {
Max int `yaml:"max" json:"max" default:"15" validate:"min=1"`
} `yaml:"age" json:"age"` // days
Size struct {
Max int `yaml:"max" json:"max" default:"50" validate:"min=1"`
} `yaml:"size" json:"size"` // in MB
Backup struct {
Max int `yaml:"max" json:"max" default:"15" validate:"min=1"`
} `yaml:"backup" json:"backup"`
}
LogInfo for logging
type Logger ¶
type Logger interface {
WithField(key string, value interface{}) Logger
WithError(err error) Logger
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
Debugln(args ...interface{})
Infoln(args ...interface{})
Warnln(args ...interface{})
Errorln(args ...interface{})
Fatalln(args ...interface{})
}
Logger of module
var Global Logger
Global the global logger
Click to show internal directories.
Click to hide internal directories.