(b *testing.B)
| 183 | } |
| 184 | |
| 185 | func BenchmarkAddCallerAndStacktrace(b *testing.B) { |
| 186 | logger := New( |
| 187 | zapcore.NewCore( |
| 188 | zapcore.NewJSONEncoder(NewProductionConfig().EncoderConfig), |
| 189 | &ztest.Discarder{}, |
| 190 | InfoLevel, |
| 191 | ), |
| 192 | AddCaller(), |
| 193 | AddStacktrace(WarnLevel), |
| 194 | ) |
| 195 | b.ResetTimer() |
| 196 | b.RunParallel(func(pb *testing.PB) { |
| 197 | for pb.Next() { |
| 198 | logger.Warn("Caller and stacktrace.") |
| 199 | } |
| 200 | }) |
| 201 | } |
| 202 | |
| 203 | func Benchmark5WithsUsed(b *testing.B) { |
| 204 | benchmarkWithUsed(b, (*Logger).With, 5, true) |
nothing calls this directly
no test coverage detected
searching dependent graphs…