Documentation ¶
Index ¶
- Constants
- Variables
- func InitWriter(cfg *WriterConfig)
- func NewWriter(level zapcore.Level, logfile string, console bool) (writes []zapcore.Core)
- type Logger
- func (this *Logger) DEBUG(format string, values ...interface{})
- func (this *Logger) ERROR(format string, values ...interface{})
- func (this *Logger) INFO(format string, values ...interface{})
- func (this *Logger) Name(name string) libs.Logger
- func (this *Logger) New() libs.Logger
- func (this *Logger) WARN(format string, values ...interface{})
- func (this *Logger) ZapLogger() *zap.Logger
- type WriterConfig
Constants ¶
View Source
const ( MaxAge = 15 // 保留旧日志文件的最大天数 MaxSize = 100 // 日志文件轮转前的最大大小(以M为单位) MaxBackups = 30 // 保留旧日志文件的最大数量 Compress = true // 指定是否对被轮转的日志文件进行gzip压缩 )
View Source
const TimeFormat = "2006-01-02 15:04:05"
Variables ¶
View Source
var (
Writers []zapcore.Core
)
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger 日志对象
type WriterConfig ¶
type WriterConfig struct { LogFile string `json:"log_file" yaml:"log_file"` LogLevel string `json:"log_level" yaml:"log_level"` IsConsole bool `json:"is_console" yaml:"is_console"` }
WriterConfig 日志配置
Click to show internal directories.
Click to hide internal directories.