mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
log test
This commit is contained in:
parent
0a36ff7eec
commit
d914eb92d4
@ -7,6 +7,7 @@
|
|||||||
package log
|
package log
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"Open_IM/pkg/utils"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"runtime"
|
"runtime"
|
||||||
@ -25,6 +26,7 @@ func (f *fileHook) Levels() []logrus.Level {
|
|||||||
|
|
||||||
func (f *fileHook) Fire(entry *logrus.Entry) error {
|
func (f *fileHook) Fire(entry *logrus.Entry) error {
|
||||||
entry.Data["FilePath"] = findCaller(6)
|
entry.Data["FilePath"] = findCaller(6)
|
||||||
|
utils.GetSelfFuncName()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +58,7 @@ func getCaller(skip int) (string, int) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
return "", 0
|
return "", 0
|
||||||
}
|
}
|
||||||
|
fmt.Println("skip:", skip, "file:", file, "line", line)
|
||||||
n := 0
|
n := 0
|
||||||
for i := len(file) - 1; i > 0; i-- {
|
for i := len(file) - 1; i > 0; i-- {
|
||||||
if file[i] == '/' {
|
if file[i] == '/' {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user