From c3318055393e0283d7699a6279f4a015be110798 Mon Sep 17 00:00:00 2001 From: Mmx <1624045573@qq.com> Date: Sat, 17 Jul 2021 16:17:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=AD=A3=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/log.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/util/log.go b/util/log.go index f468fc1..d8794b7 100644 --- a/util/log.go +++ b/util/log.go @@ -17,6 +17,9 @@ type loG struct { var Log loG func (*loG) WriteLog(name string, a ...interface{}) { + if !global.Config.Settings.DemoMode { + return + } for _, v := range a { var t string switch reflect.TypeOf(v).Kind() { @@ -41,22 +44,20 @@ func (c *loG) genTimeStamp() { } func (c *loG) Println(a ...interface{}) { + c.genTimeStamp() + c.WriteLog("Login-"+c.timeStamp+".log", a...) if !global.Status.Output { return } - c.genTimeStamp() - if global.Config.Settings.DemoMode { - c.WriteLog("Login-"+c.timeStamp+".log", a...) - } log.Println(a...) } func (c *loG) Fatalln(a ...interface{}) { + c.genTimeStamp() + c.WriteLog("LoginError-"+c.timeStamp+".log", a...) if !global.Status.Output { return } - c.genTimeStamp() - c.WriteLog("LoginError-"+c.timeStamp+".log", a...) log.Fatalln(a...) }