From 12e6cbb9e5958472fd548480a6b29a7069a8e744 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 29 Aug 2022 16:11:56 +0800 Subject: [PATCH] add --- pkg/common/log/logrus.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkg/common/log/logrus.go b/pkg/common/log/logrus.go index a10669452..a19292e71 100644 --- a/pkg/common/log/logrus.go +++ b/pkg/common/log/logrus.go @@ -2,6 +2,7 @@ package log import ( "Open_IM/pkg/common/config" + "bufio" //"bufio" "fmt" @@ -34,13 +35,13 @@ func loggerInit(moduleName string) *Logger { //All logs will be printed logger.SetLevel(logrus.Level(config.Config.Log.RemainLogLevel)) //Close std console output - // src, err := os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend) - // if err != nil { - // panic(err.Error()) - // } - // writer := bufio.NewWriter(src) - // logger.SetOutput(writer) - logger.SetOutput(os.Stdout) + src, err := os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend) + if err != nil { + panic(err.Error()) + } + writer := bufio.NewWriter(src) + logger.SetOutput(writer) + // logger.SetOutput(os.Stdout) //Log Console Print Style Setting logger.SetFormatter(&nested.Formatter{ TimestampFormat: "2006-01-02 15:04:05.000",