From 2e7a1e3abec81eaa6e2bf616814a1f4823c7b7cb Mon Sep 17 00:00:00 2001 From: Gerald Wagner Date: Wed, 21 May 2025 10:27:03 +0200 Subject: [PATCH] Draft: Print full stack for executed queries --- utils.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/utils.go b/utils.go index dfaae939..7b9376c1 100644 --- a/utils.go +++ b/utils.go @@ -6,7 +6,7 @@ import ( "fmt" "reflect" "regexp" - "runtime" + "runtime/debug" "strings" "sync" "time" @@ -175,13 +175,7 @@ func toQueryValues(values [][]interface{}) (results []interface{}) { } func fileWithLineNum() string { - for i := 2; i < 15; i++ { - _, file, line, ok := runtime.Caller(i) - if ok && (!goSrcRegexp.MatchString(file) || goTestRegexp.MatchString(file)) { - return fmt.Sprintf("%v:%v", file, line) - } - } - return "" + return fmt.Sprintf("Stack trace:\n%s", debug.Stack()) } func isBlank(value reflect.Value) bool {