pull/455/head
Gordon 2 years ago committed by Xinwei Xiong(cubxxw-openim)
parent 0a36ff7eec
commit d914eb92d4

@ -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] == '/' {

Loading…
Cancel
Save