Documentation ¶
Index ¶
Constants ¶
View Source
const ( //LogFileName is the log file prefix name LogFileName = "kingbus.log" //LogFileMaxSize is the max size of log file LogFileMaxSize int = 100 //MB //LogMaxBackups is the max backup count of log file LogMaxBackups = 20 //LogMaxAge is the max time to save log file LogMaxAge = 28 //days )
Variables ¶
View Source
var Log *zap.SugaredLogger
Log is a global var of log
View Source
var Logger *zap.Logger
Logger is a global var of zap log
Functions ¶
func CallerEncoder ¶
func CallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
CallerEncoder will add caller to log. format is "filename:lineNum:", e.g:"zaplog/zaplog_test.go:15"
Types ¶
Click to show internal directories.
Click to hide internal directories.