Documentation ¶
Index ¶
- Variables
- func DPanic(msg string, fields ...zap.Field)
- func Debug(msg string, fields ...zap.Field)
- func Error(msg string, fields ...zap.Field)
- func Info(msg string, fields ...zap.Field)
- func Panic(msg string, fields ...zap.Field)
- func Warn(msg string, fields ...zap.Field)
- type Logs
- func (logs *Logs) Register() *zap.Logger
- func (logs *Logs) SetCompress(compress bool) *Logs
- func (logs *Logs) SetConsole(console bool) *Logs
- func (logs *Logs) SetFormat(format string) *Logs
- func (logs *Logs) SetLevel(level string) *Logs
- func (logs *Logs) SetMaxAge(MaxAge int) *Logs
- func (logs *Logs) SetMaxBackups(MaxBackups int) *Logs
- func (logs *Logs) SetMaxSize(MaxSize int) *Logs
- func (logs *Logs) SetPath(path string) *Logs
- func (logs *Logs) SetServiceName(ServiceName string) *Logs
Constants ¶
This section is empty.
Variables ¶
View Source
var Write *zap.Logger
Write Inherit zap log
Functions ¶
Types ¶
type Logs ¶
type Logs struct { Path string //Save Path Level string //Set log level,info debug warn MaxBackups int //Keep 30 backups, 300 by default MaxSize int //Each log file saves 10M, the default is 10M MaxAge int //7 days reserved, 180 days by default Compress bool //Whether to compress, no compression by default ServiceName string //Log service name, default antgo Format string //Log format default console Console bool //Whether to output the console display }
Logs parameter structure
func (*Logs) SetCompress ¶
SetCompress Do you need compression
func (*Logs) SetConsole ¶
SetConsole Whether to output the console display<是否控制台打印>
func (*Logs) SetMaxBackups ¶
SetMaxBackups setting log
func (*Logs) SetMaxSize ¶
SetMaxSize Set log maximum
func (*Logs) SetServiceName ¶
SetServiceName setting log<打印日志服务名称>
Click to show internal directories.
Click to hide internal directories.