Merge pull request #8025 from fuweid/enhance-testlog

log/logtest: add `testcase` as debug field
This commit is contained in:
Phil Estes 2023-01-30 11:40:15 -05:00 committed by GitHub
commit 0b81378be6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,5 +52,5 @@ func WithT(ctx context.Context, t testing.TB) context.Context {
},
})
return log.WithLogger(ctx, logrus.NewEntry(l))
return log.WithLogger(ctx, logrus.NewEntry(l).WithField("testcase", t.Name()))
}