feat:简化main函数

This commit is contained in:
Mmx
2021-07-11 13:05:10 +08:00
parent f3f122a1c5
commit cd15385aec
4 changed files with 44 additions and 31 deletions

View File

@@ -4,7 +4,9 @@ import (
"Mmx/Global"
"fmt"
"log"
"os"
"reflect"
"runtime"
"time"
)
@@ -57,3 +59,12 @@ func (c *loG) Fatalln(a ...interface{}) {
c.WriteLog("LoginError-"+c.timeStamp+".log", a...)
log.Fatalln(a...)
}
func (c *loG) CatchRecover() {
if e := recover(); e != nil {
c.Println(e)
var buf [4096]byte
c.Println(string(buf[:runtime.Stack(buf[:], false)]))
os.Exit(1)
}
}