package errh
import (
"dog/util/log"
"runtime"
)
func Dao(err error) error {
if err != nil {
for i := 1; ; i++ {
pc, file, line, ok := runtime.Caller(i)
if !ok {
break
}
f := runtime.FuncForPC(pc)
if f.Name() != "runtime.main" && f.Name() != "runtime.goexit" {
log.Error.Println("file:", file, "line:", line, "funcName:", f.Name(), "error:", err.Error())
}
}
}
return err
}
有疑问加站长微信联系(非本文作者)