Documentation ¶
Index ¶
- Variables
- func AsyncInfo(msg string, args ...interface{})
- func Debug(msg string, args ...interface{})
- func Errors(msg string, args ...interface{})
- func FormateLog(args []interface{}) *zap.Logger
- func Info(msg string, args ...interface{})
- func Panic(msg string, args ...interface{})
- func ToJsonData(args []interface{}) zap.Field
- func Warn(msg string, args ...interface{})
- 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 ¶ added in v1.3.0
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 1M MaxAge int //7 days reserved, 30 days by default Compress bool //Whether to compress, no compression by default ServiceName string //Log service name, default Ginp Format string //Log format default console Console bool //Whether to output the console display }
Log parameter structure
func (*Logs) SetCompress ¶ added in v1.3.0
SetCompress Do you need compression
func (*Logs) SetConsole ¶ added in v1.3.0
SetConsole Whether to output the console display
func (*Logs) SetMaxBackups ¶ added in v1.3.0
SetMaxBackups setting log
func (*Logs) SetMaxSize ¶ added in v1.3.0
SetMaxSize Set log maximum
func (*Logs) SetServiceName ¶ added in v1.3.0
SetServiceName setting log
Click to show internal directories.
Click to hide internal directories.