create test to prove issue sirupsen/logrus#954

This commit is contained in:
Alisdair MacLeod 2020-03-19 09:29:19 +00:00
parent 7ea96a3284
commit e76a5c4450
1 changed files with 11 additions and 0 deletions

View File

@ -243,3 +243,14 @@ func TestEntryLogfLevel(t *testing.T) {
entry.Logf(WarnLevel, "%s", "warn") entry.Logf(WarnLevel, "%s", "warn")
assert.Contains(t, buffer.String(), "warn") assert.Contains(t, buffer.String(), "warn")
} }
func TestEntryReportCallerRace(t *testing.T) {
logger := New()
entry := NewEntry(logger)
go func() {
logger.SetReportCaller(true)
}()
go func() {
entry.Info("should not race")
}()
}