mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
log
This commit is contained in:
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…
x
Reference in New Issue
Block a user