(t *testing.T)
| 272 | } |
| 273 | |
| 274 | func TestEntryReportCallerRace(t *testing.T) { |
| 275 | logger := New() |
| 276 | entry := NewEntry(logger) |
| 277 | |
| 278 | // logging before SetReportCaller has the highest chance of causing a race condition |
| 279 | // to be detected, but doing it twice just to increase the likelihood of detecting the race |
| 280 | go func() { |
| 281 | entry.Info("should not race") |
| 282 | }() |
| 283 | go func() { |
| 284 | logger.SetReportCaller(true) |
| 285 | }() |
| 286 | go func() { |
| 287 | entry.Info("should not race") |
| 288 | }() |
| 289 | } |
| 290 | |
| 291 | func TestEntryFormatterRace(t *testing.T) { |
| 292 | logger := New() |
nothing calls this directly
no test coverage detected