From 36d4ca844a1c0fbcd213e2796e67b69eb4883240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 30 Sep 2024 15:25:17 +0800 Subject: [PATCH] update debug strack --- response/response.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(),