improve stack feature for package gdebug/gerror

This commit is contained in:
John Guo
2021-02-04 00:10:13 +08:00
parent 3b2bae6128
commit fefde4c290
6 changed files with 211 additions and 80 deletions

View File

@ -9,6 +9,7 @@ package gdebug
import (
"bytes"
"fmt"
"github.com/gogf/gf/internal/utils"
"runtime"
"strings"
)
@ -82,6 +83,11 @@ func StackWithFilters(filters []string, skip ...int) string {
if strings.Contains(file, stackFilterKey) {
continue
}
if !utils.IsDebugEnabled() {
if strings.Contains(file, utils.StackFilterKeyForGoFrame) {
continue
}
}
if fn := runtime.FuncForPC(pc); fn == nil {
name = "unknown"
} else {