李度、马也驰 25spring数据库系统 p1仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
283 B

package logprovider
import (
"fmt"
"os"
"runtime/debug"
)
func DebugTraceback(errFuncName string) {
if r := recover(); r != nil {
msg := fmt.Sprintf("panic in goroutine: %v\n%s", r, debug.Stack())
f, _ := os.Create(errFuncName + ".log")
fmt.Fprint(f, msg)
f.Close()
}
}