diff --git a/pkg/common/trace_log/ctx.go b/pkg/common/trace_log/ctx.go index 7e32a0db0..0909dfdc6 100644 --- a/pkg/common/trace_log/ctx.go +++ b/pkg/common/trace_log/ctx.go @@ -180,11 +180,12 @@ func SetContextInfo(ctx context.Context, funcName string, logLevel logrus.Level, funcInfo.Err = err funcInfo.LogLevel = logLevel _, file, line, _ := runtime.Caller(0) + var s string i := strings.SplitAfter(file, "/") if len(i) > 3 { file = i[len(i)-3] + i[len(i)-2] + i[len(i)-1] + ":" + utils.IntToString(line) } - funcInfo.File = file + funcInfo.File = s *t.Funcs = append(*t.Funcs, funcInfo) }