From 2aa0d839b3474d50bd04b50e9913208e9f1819ae Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Tue, 27 Dec 2022 17:29:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/init/log/log.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/init/log/log.go b/backend/init/log/log.go index 6d31f916d..08c0a5588 100644 --- a/backend/init/log/log.go +++ b/backend/init/log/log.go @@ -53,16 +53,15 @@ func setOutput(logger *logrus.Logger, config configs.LogConfig) { type MineFormatter struct{} func (s *MineFormatter) Format(entry *logrus.Entry) ([]byte, error) { - var cstSh, _ = time.LoadLocation(global.CONF.LogConfig.TimeZone) detailInfo := "" if entry.Caller != nil { funcion := strings.ReplaceAll(entry.Caller.Function, "github.com/1Panel-dev/1Panel/backend/", "") detailInfo = fmt.Sprintf("(%s: %d)", funcion, entry.Caller.Line) } if len(entry.Data) == 0 { - msg := fmt.Sprintf("[%s] [%s] %s %s \n", time.Now().In(cstSh).Format(TimeFormat), strings.ToUpper(entry.Level.String()), entry.Message, detailInfo) + msg := fmt.Sprintf("[%s] [%s] %s %s \n", time.Now().Format(TimeFormat), strings.ToUpper(entry.Level.String()), entry.Message, detailInfo) return []byte(msg), nil } - msg := fmt.Sprintf("[%s] [%s] %s %s {%v} \n", time.Now().In(cstSh).Format(TimeFormat), strings.ToUpper(entry.Level.String()), entry.Message, detailInfo, entry.Data) + msg := fmt.Sprintf("[%s] [%s] %s %s {%v} \n", time.Now().Format(TimeFormat), strings.ToUpper(entry.Level.String()), entry.Message, detailInfo, entry.Data) return []byte(msg), nil }