mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-07 23:02:12 +02:00
fix log caller (#1025)
This commit is contained in:
parent
05c2e16b9e
commit
5d1228a5d7
@ -33,7 +33,7 @@ func Value(ctx context.Context, v interface{}) interface{} {
|
||||
func Caller(depth int) Valuer {
|
||||
return func(context.Context) interface{} {
|
||||
_, file, line, _ := runtime.Caller(depth)
|
||||
if strings.LastIndex(file, "github.com/go-kratos/kratos/log") > 0 {
|
||||
if strings.LastIndex(file, "/log/helper.go") > 0 {
|
||||
_, file, line, _ = runtime.Caller(depth + 1)
|
||||
}
|
||||
idx := strings.LastIndexByte(file, '/')
|
||||
|
Loading…
Reference in New Issue
Block a user