升级包装的日志库

This commit is contained in:
2021-03-05 00:41:33 +08:00
parent c663438a27
commit d539f84737
5 changed files with 62 additions and 15 deletions

View File

@ -23,12 +23,11 @@ import (
//
// Date : 5:50 下午 2021/1/2
func Test_Logger(t *testing.T) {
encoder := GetEncoder(WithTimeEncoder(MsTimeEncoder))
c, err := NewRotateLogConfig("./logs", "test.log", WithTimeIntervalType(TimeIntervalTypeMinute), WithMaxAge(120*time.Second))
if nil != err {
panic(err)
}
l, err := NewLogger(zapcore.InfoLevel, true, encoder, c)
l, err := NewLogger(zapcore.InfoLevel, c, WithCallerSkip(1), WithConsoleOutput())
if nil != err {
panic(err)
}