panic.go 248 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4 5 6 7 8 9 10 11 12 13
package utils

import (
	"git.hilo.cn/hilo-common/mylogrus"
	"runtime/debug"
)

func CheckGoPanic() {
	if r := recover(); r != nil {
		//打印错误堆栈信息
		mylogrus.MyLog.Errorf("ACTION PANIC: %v, stack: %v", r, string(debug.Stack()))
	}
}