From c663438a27a3135f9eddc85dbb1daf1f72e841ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BE=B7=E6=BB=A1?= Date: Fri, 5 Mar 2021 00:20:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9C=9F=E6=98=AF=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E8=A1=8C=E5=8F=B7=E7=9A=84=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logger/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logger/logger.go b/logger/logger.go index 631805c..6795080 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -61,7 +61,7 @@ func NewLogger(loggerLevel zapcore.Level, consoleOutput bool, encoder zapcore.En core := zapcore.NewTee(fileHandlerList...) // 需要传入 zap.AddCaller() 才会显示打日志点的文件名和行数, 跳过一行可以直接显示业务代码行号,否则显示日志包行号 - log := zap.New(core, zap.AddCaller(), zap.AddCallerSkip(1)) + log := zap.New(core, zap.AddCaller(), zap.AddCallerSkip(-1)) return log, nil }