fix: 修复 log 日志切割不生效问题

This commit is contained in:
kercylan98 2023-12-11 11:26:24 +08:00
parent b4ade2c003
commit 9068c57299
1 changed files with 4 additions and 2 deletions

View File

@ -12,8 +12,10 @@ type Encoder struct {
conf *Config conf *Config
} }
func (slf *Encoder) Split(config *lumberjack.Logger) *Encoder { func (slf *Encoder) Split(config *lumberjack.Logger, level LevelEnabler) *Encoder {
slf.cores = append(slf.cores, zapcore.NewCore(slf.e, zapcore.AddSync(config), zapcore.DebugLevel)) slf.cores = append(slf.cores, zapcore.NewCore(slf.e,
zapcore.NewMultiWriteSyncer(zapcore.AddSync(config)),
level))
return slf return slf
} }