diff --git a/pkg/logx/define.go b/pkg/logx/define.go index 0ced49c..e7e2122 100644 --- a/pkg/logx/define.go +++ b/pkg/logx/define.go @@ -2,7 +2,6 @@ package logx import ( "context" - "fmt" "gitee.com/timedb/wheatCache/pkg/event" "github.com/spf13/viper" "sync" @@ -23,7 +22,6 @@ type upLogger struct { func init() { once.Do(func() { stath = viper.GetStringSlice("logPrint.stath") - fmt.Println(stath) }) } diff --git a/pkg/logx/logx.go b/pkg/logx/logx.go index a02626b..8ae7ebd 100644 --- a/pkg/logx/logx.go +++ b/pkg/logx/logx.go @@ -5,6 +5,7 @@ import ( "fmt" "gitee.com/timedb/wheatCache/pkg/event" middleMsg "gitee.com/timedb/wheatCache/pkg/middle-msg" + "os" "runtime" "strings" "time" @@ -31,6 +32,7 @@ func (l *upLogger) Error(format string, msg ...interface{}) { } func (l *upLogger) Panic(format string, msg ...interface{}) { Print("ERROR", format, msg...) + os.Exit(-1) } func (l *upLogger) Print(level string, format string, msg ...interface{}) { @@ -57,6 +59,7 @@ func Error(format string, msg ...interface{}) { func Panic(format string, msg ...interface{}) { Print("ERROR", format, msg...) + os.Exit(-1) } func Print(level string, format string, msg ...interface{}) {