fix(log) fix panic, remove fmt.Print

This commit is contained in:
黎白南 2021-10-06 19:14:16 +08:00
parent 87ada5f981
commit d8dc56d95a
2 changed files with 3 additions and 2 deletions

View File

@ -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)
})
}

View File

@ -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{}) {