pull/168/head
Gordon 3 years ago
parent af2917adb9
commit 7e9234e712

@ -31,9 +31,9 @@ func (f *fileHook) Levels() []logrus.Level {
func (f *fileHook) Fire(entry *logrus.Entry) error { func (f *fileHook) Fire(entry *logrus.Entry) error {
var s string var s string
_, b, c, _ := runtime.Caller(8) _, b, c, _ := runtime.Caller(8)
i := strings.LastIndex(b, "/") i := strings.SplitAfter(b, "/")
if i != -1 { if len(i) > 3 {
s = b[i+1:len(b)] + ":" + utils.IntToString(c) s = i[len(i)-3] + i[len(i)-2] + i[len(i)-1] + ":" + utils.IntToString(c)
} }
entry.Data["FilePath"] = s entry.Data["FilePath"] = s
return nil return nil

Loading…
Cancel
Save