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

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()))
}