优化recover日志

This commit is contained in:
duanhf2012
2021-07-26 17:45:32 +08:00
parent a6ea25bba0
commit be98b62979
5 changed files with 15 additions and 7 deletions

View File

@@ -94,8 +94,8 @@ func (t *Timer) Do(){
if r := recover(); r != nil {
buf := make([]byte, 4096)
l := runtime.Stack(buf, false)
err := fmt.Errorf("%v: %s", r, buf[:l])
log.SError("core dump info:", err.Error())
errString := fmt.Sprint(r)
log.SError("core dump info[",errString,"]\n",string(buf[:l]))
}
}()
t.cb()