From 1166752b6f9bd3ce80aa6ae7dc243ca64c851cb7 Mon Sep 17 00:00:00 2001 From: cvictory Date: Tue, 18 Aug 2020 14:54:06 +0800 Subject: [PATCH] forbid excuting twice --- common/logger/logger.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/logger/logger.go b/common/logger/logger.go index b648f8a0af..63eda231dd 100644 --- a/common/logger/logger.go +++ b/common/logger/logger.go @@ -60,6 +60,10 @@ type Logger interface { } func init() { + // forbidden to executing twice. + if logger != nil { + return + } logConfFile := os.Getenv(constant.APP_LOG_CONF_FILE) err := InitLog(logConfFile) if err != nil {