Documentation ¶
Index ¶
Constants ¶
View Source
const ( CallerTag = "caller" LevelTag = "level" MsgTag = "msg" TimeTag = "time" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // 日志: std, file 多种类型按照逗号隔开 Out string `toml:"out"` // 日志类别: debug, warn, info,error Level string `toml:"level"` // Out包含file,需要配置 File *File `toml:"file"` }
Config 日志配置
func (*Config) GetFileConfig ¶
type Field ¶ added in v1.0.0
type Field func(IFields)
func FieldInt32 ¶ added in v1.0.0
func FieldInt64 ¶ added in v1.0.0
func FieldString ¶ added in v1.0.0
type File ¶
type File struct { // 日志文件目录 项目目录 Path string `toml:"path"` // 日志文件默认名称 default.log FileName string `toml:"file_name"` // 最大文件容量(单位:M),默认:128 MaxSize int `toml:"max_size"` // 最大的备份数量,默认:30 MaxBackups int `toml:"max_backups"` // 最大备份天数,默认:0,没有限制 MaxAge int `toml:"max_age"` // 是否gzip压缩 Compress bool `toml:"compress"` }
File 日志文件类别配置
type IData ¶
type ILogger ¶
type ILogger interface { Debugf(msg string, values ...interface{}) Infof(msg string, values ...interface{}) Warnf(msg string, values ...interface{}) Errorf(msg string, values ...interface{}) Debug(msg string, values ...Field) Info(msg string, values ...Field) Warn(msg string, values ...Field) Error(msg string, values ...Field) }
Click to show internal directories.
Click to hide internal directories.