|
|
@ -33,11 +33,11 @@ func Value(ctx context.Context, v interface{}) interface{} { |
|
|
|
func Caller(depth int) Valuer { |
|
|
|
func Caller(depth int) Valuer { |
|
|
|
return func(context.Context) interface{} { |
|
|
|
return func(context.Context) interface{} { |
|
|
|
_, file, line, _ := runtime.Caller(depth) |
|
|
|
_, file, line, _ := runtime.Caller(depth) |
|
|
|
if strings.LastIndex(file, "/log/helper.go") > 0 { |
|
|
|
if strings.LastIndex(file, "/log/filter.go") > 0 { |
|
|
|
depth++ |
|
|
|
depth++ |
|
|
|
_, file, line, _ = runtime.Caller(depth) |
|
|
|
_, file, line, _ = runtime.Caller(depth) |
|
|
|
} |
|
|
|
} |
|
|
|
if strings.LastIndex(file, "/log/filter.go") > 0 { |
|
|
|
if strings.LastIndex(file, "/log/helper.go") > 0 { |
|
|
|
depth++ |
|
|
|
depth++ |
|
|
|
_, file, line, _ = runtime.Caller(depth) |
|
|
|
_, file, line, _ = runtime.Caller(depth) |
|
|
|
} |
|
|
|
} |
|
|
|