mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
log
This commit is contained in:
parent
e6b302abf9
commit
25f24801d6
@ -2,6 +2,7 @@ package log
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"Open_IM/pkg/common/config"
|
"Open_IM/pkg/common/config"
|
||||||
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
@ -32,13 +33,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