Draft: Print full stack for executed queries

This commit is contained in:
Gerald Wagner 2025-05-21 10:27:03 +02:00
parent ccdd740abf
commit 2e7a1e3abe

View File

@ -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 {