Documentation
¶
Index ¶
- Constants
- func Byte2(level int8, b []byte) string
- func Configure(config Config) error
- func Debug(format string, args ...interface{})
- func Error(format string, args ...interface{})
- func ErrorWith(err error, format string, args ...interface{})
- func Fatal(format string, args ...interface{})
- func Info(format string, args ...interface{})
- func NDebug(format string, args ...interface{})
- func Panic(format string, args ...interface{})
- func Warn(format string, args ...interface{})
- type Config
Constants ¶
View Source
const ( DebugLevel = int8(zerolog.DebugLevel) InfoLevel = int8(zerolog.InfoLevel) // WarnLevel defines warn log level. WarnLevel = int8(zerolog.WarnLevel) // ErrorLevel defines error log level. ErrorLevel = int8(zerolog.ErrorLevel) // FatalLevel defines fatal log level. FatalLevel = int8(zerolog.FatalLevel) // PanicLevel defines panic log level. PanicLevel = int8(zerolog.PanicLevel) )
对外进行统一的封装
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Level int `json:"level" yaml:"level" xml:"level"` // Enable console logging ConsoleEnabled bool `json:"console" yaml:"console" xml:"console"` // FileLoggingEnabled makes the framework log to a file // the fields below can be skipped if this value is false! FileEnabled bool `json:"file" yaml:"file" xml:"file"` // Directory to log to to when filelogging is enabled Path string `json:"path" yaml:"path" xml:"path"` // Filename is the name of the logfile which will be placed inside the directory Filename string `json:"fileName" yaml:"fileName" xml:"fileName"` // MaxSize the max size in MB of the logfile before it's rolled MaxSize int `json:"maxSize" yaml:"maxSize" xml:"maxSize"` // MaxBackups the max number of rolled files to keep MaxBackups int `json:"backupNum" yaml:"backupNum" xml:"backupNum"` // MaxAge the max age in days to keep a logfile MaxAge int `json:"days" json:"days" xml:"days"` }
Click to show internal directories.
Click to hide internal directories.