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 {
var s string
_, b, c, _ := runtime.Caller(8)
i := strings.LastIndex(b, "/")
if i != -1 {
s = b[i+1:len(b)] + ":" + utils.IntToString(c)
i := strings.SplitAfter(b, "/")
if len(i) > 3 {
s = i[len(i)-3] + i[len(i)-2] + i[len(i)-1] + ":" + utils.IntToString(c)
}
entry.Data["FilePath"] = s
return nil

Loading…
Cancel
Save