From e74d0280bef2921b67728f0093b36ede19dfbffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Wed, 15 Dec 2021 09:21:08 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logger.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/logger.go b/logger.go index dd6024c..34c2447 100644 --- a/logger.go +++ b/logger.go @@ -10,7 +10,9 @@ var Say *zap.SugaredLogger // 避免异常,在第一次调用时初始化一个只打印到控制台的logger func init() { - InitLogger(LogConfig{Mode: Dev, LokiEnable: false, FileEnable: false}) + if Say == nil { + InitLogger(LogConfig{Mode: Dev, LokiEnable: false, FileEnable: false}) + } } // InitLogger 初始化日志工具