Draft: Print full stack for executed queries
This commit is contained in:
parent
ccdd740abf
commit
2e7a1e3abe
10
utils.go
10
utils.go
@ -6,7 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
"runtime/debug"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -175,13 +175,7 @@ func toQueryValues(values [][]interface{}) (results []interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func fileWithLineNum() string {
|
func fileWithLineNum() string {
|
||||||
for i := 2; i < 15; i++ {
|
return fmt.Sprintf("Stack trace:\n%s", debug.Stack())
|
||||||
_, file, line, ok := runtime.Caller(i)
|
|
||||||
if ok && (!goSrcRegexp.MatchString(file) || goTestRegexp.MatchString(file)) {
|
|
||||||
return fmt.Sprintf("%v:%v", file, line)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func isBlank(value reflect.Value) bool {
|
func isBlank(value reflect.Value) bool {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user