close console log

pull/141/head
Gordon 3 years ago
parent ed2a5af5ed
commit 84d4645efa

@ -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,12 +33,12 @@ 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{

Loading…
Cancel
Save