fix log caller (#1025)

pull/1030/head
包子 3 years ago committed by GitHub
parent 05c2e16b9e
commit 5d1228a5d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      log/value.go

@ -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…
Cancel
Save