diff --git a/response/response.go b/response/response.go index d6f249e..80e690a 100644 --- a/response/response.go +++ b/response/response.go @@ -10,7 +10,7 @@ package response import ( "fmt" "net/http" - "runtime/debug" + "runtime" "time" "git.zhangdeman.cn/zhangdeman/exception" @@ -109,7 +109,10 @@ func SendWithException(ctx *gin.Context, e exception.IException, data any) { e = exception.NewSuccess(data) } if !define.GetHttpHandleConfig().DisableDebugStackOutput { - debug.PrintStack() + pc, file, line, ok := runtime.Caller(1) + if ok { + fmt.Println(runtime.FuncForPC(pc).Name(), file, line) + } } outputData := map[string]any{ "e_data": e.GetData(),