From c8e9f1d0fd4a97a20da76e7e65f403c1e56dc9d6 Mon Sep 17 00:00:00 2001 From: tiglog Date: Tue, 17 Oct 2023 18:22:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=A4=E4=B8=AA=20With=20=E6=94=B9?= =?UTF-8?q?=E5=9C=A8=20Core=20=E4=B8=8A=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logger/log.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/logger/log.go b/logger/log.go index 880255d..84da339 100644 --- a/logger/log.go +++ b/logger/log.go @@ -95,11 +95,12 @@ func Default() *Logger { return std } func ReplaceDefault(l *Logger) { std = l } func SetLevel(level Level) { std.SetLevel(level) } + func With(fields ...Field) { - std.l.With(fields...) + std.l.Core().With(fields) } func WithRequestId(reqId string) { - std.l.With(String("reqId", reqId)) + std.l.Core().With([]Field{String("reqId", reqId)}) } func Debug(msg string, fields ...Field) { std.Debug(msg, fields...) }