diff --git a/pkg/common/log/file_line_hk.go b/pkg/common/log/file_line_hk.go index bc908ee03..23d46c271 100644 --- a/pkg/common/log/file_line_hk.go +++ b/pkg/common/log/file_line_hk.go @@ -7,6 +7,7 @@ package log import ( + "Open_IM/pkg/utils" "fmt" "github.com/sirupsen/logrus" "runtime" @@ -25,6 +26,7 @@ func (f *fileHook) Levels() []logrus.Level { func (f *fileHook) Fire(entry *logrus.Entry) error { entry.Data["FilePath"] = findCaller(6) + utils.GetSelfFuncName() return nil } @@ -56,7 +58,7 @@ func getCaller(skip int) (string, int) { if !ok { return "", 0 } - + fmt.Println("skip:", skip, "file:", file, "line", line) n := 0 for i := len(file) - 1; i > 0; i-- { if file[i] == '/' {