Documentation ¶
Index ¶
- func AddFixedField(key string, value interface{})
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func Fatal(format string, v ...interface{})
- func Info(format string, v ...interface{})
- func SetAppName(appName string)
- func SetConsoleLevel(logLevel string)
- func SetFileLevel(logLevel string)
- func SetFixedFields(fields logrus.Fields)
- func SetLogFileDir(dir string) error
- func SetLogRotationMaxFileCount(fileCount uint)
- func SetLogRotationTime(duration time.Duration)
- func Warning(format string, v ...interface{})
- type ChinaClock
- type Formatter
- type LogConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogRotationMaxFileCount ¶
func SetLogRotationMaxFileCount(fileCount uint)
SetLogRotationMaxFileCount 设置日志文件分割最大个数
func SetLogRotationTime ¶
SetLogRotationTime 设置日志文件分割时长(NOTE: 最小有效时间间隔为小时)
Types ¶
type Formatter ¶
type Formatter struct { FieldsOrder []string // default: fields sorted alphabetically TimestampFormat string // default: time.StampMilli = "Jan _2 15:04:05.000" HideKeys bool // show [fieldValue] instead of [fieldKey:fieldValue] NoColors bool // disable colors NoFieldsColors bool // color only level, default is level + fields ShowFullLevel bool // true to show full level [WARNING] instead [WARN] TrimMessages bool // true to trim whitespace on messages }
Formatter 自定义格式控制选项
Click to show internal directories.
Click to hide internal directories.