Get right logrus package name

This commit is contained in:
Alex S
2020-02-27 11:04:36 +08:00
parent 77ab282a06
commit 86a84a9d18
3 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -185,7 +185,7 @@ func getCaller() *runtime.Frame {
callerInitOnce.Do(func() {
pcs := make([]uintptr, 2)
_ = runtime.Callers(0, pcs)
logrusPackage = getPackageName(runtime.FuncForPC(pcs[1]).Name())
logrusPackage = getPackageName(funcName(pcs))
// now that we have the cache, we can skip a minimum count of known-logrus functions
// XXX this is dubious, the number of frames may vary