improve debugging feature

This commit is contained in:
John Guo
2021-12-04 23:07:54 +08:00
parent 8586f31e03
commit 0e3a8576b4
6 changed files with 21 additions and 38 deletions

View File

@ -15,7 +15,6 @@ import (
"strings"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/internal/utils"
)
// Error is custom error for additional features.
@ -201,14 +200,8 @@ func formatSubStack(st stack, buffer *bytes.Buffer) {
if fn := runtime.FuncForPC(p - 1); fn != nil {
file, line := fn.FileLine(p - 1)
// Custom filtering.
if !utils.IsDebugEnabled() {
if strings.Contains(file, utils.StackFilterKeyForGoFrame) {
continue
}
} else {
if strings.Contains(file, stackFilterKeyLocal) {
continue
}
if strings.Contains(file, stackFilterKeyLocal) {
continue
}
// Avoid stack string like "`autogenerated`"
if strings.Contains(file, "<") {