refactor:优化日志打印方式

This commit is contained in:
Mmx
2021-05-03 14:30:15 +08:00
parent fb562f92c9
commit 7ceb7169e5
6 changed files with 36 additions and 32 deletions

View File

@@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"io"
"log"
"os"
"regexp"
)
@@ -50,11 +51,10 @@ func Sha1(content string) string {
func ErrHandler(err error) {
if err != nil {
fmt.Println("运行出错,状态异常")
log.Println("运行出错,状态异常")
if Global.Config.Settings.DemoMode {
panic(err)
log.Fatalln(err)
}
fmt.Println(err)
os.Exit(3)
os.Exit(1)
}
}