mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 19:22:46 +08:00
fix log
This commit is contained in:
parent
60029fc618
commit
e4bbd57c41
@ -2,6 +2,8 @@ package log
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"Open_IM/pkg/common/config"
|
"Open_IM/pkg/common/config"
|
||||||
|
"bufio"
|
||||||
|
|
||||||
//"bufio"
|
//"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
@ -33,13 +35,13 @@ func loggerInit(moduleName string) *Logger {
|
|||||||
//All logs will be printed
|
//All logs will be printed
|
||||||
logger.SetLevel(logrus.Level(config.Config.Log.RemainLogLevel))
|
logger.SetLevel(logrus.Level(config.Config.Log.RemainLogLevel))
|
||||||
//Close std console output
|
//Close std console output
|
||||||
//src, err := os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend)
|
src, err := os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend)
|
||||||
//if err != nil {
|
if err != nil {
|
||||||
// panic(err.Error())
|
panic(err.Error())
|
||||||
//}
|
}
|
||||||
//writer := bufio.NewWriter(src)
|
writer := bufio.NewWriter(src)
|
||||||
//logger.SetOutput(writer)
|
logger.SetOutput(writer)
|
||||||
logger.SetOutput(os.Stdout)
|
//logger.SetOutput(os.Stdout)
|
||||||
//Log Console Print Style Setting
|
//Log Console Print Style Setting
|
||||||
logger.SetFormatter(&nested.Formatter{
|
logger.SetFormatter(&nested.Formatter{
|
||||||
TimestampFormat: "2006-01-02 15:04:05.000",
|
TimestampFormat: "2006-01-02 15:04:05.000",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user