From 9068c57299322a7ddca5285910f8cbf55908a73e Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Mon, 11 Dec 2023 11:26:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20log=20=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=88=87=E5=89=B2=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/log/encoder.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/log/encoder.go b/utils/log/encoder.go index 218cc49..0ebcca5 100644 --- a/utils/log/encoder.go +++ b/utils/log/encoder.go @@ -12,8 +12,10 @@ type Encoder struct { conf *Config } -func (slf *Encoder) Split(config *lumberjack.Logger) *Encoder { - slf.cores = append(slf.cores, zapcore.NewCore(slf.e, zapcore.AddSync(config), zapcore.DebugLevel)) +func (slf *Encoder) Split(config *lumberjack.Logger, level LevelEnabler) *Encoder { + slf.cores = append(slf.cores, zapcore.NewCore(slf.e, + zapcore.NewMultiWriteSyncer(zapcore.AddSync(config)), + level)) return slf }