Skip to content

Commit 26f2029

Browse files
authored
chore: Remove IgnoreErrors check for test logger (#109)
1 parent c25eab1 commit 26f2029

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

sloggers/slogtest/t.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ func (ts testSink) LogEntry(ctx context.Context, ent slog.SinkEntry) {
6161
ts.tb.Error(s)
6262
}
6363
case slog.LevelFatal:
64-
if ts.opts.IgnoreErrors {
65-
panic("slogtest: cannot fatal in tests when IgnoreErrors option is set")
66-
}
6764
ts.tb.Fatal(s)
6865
}
6966
}

sloggers/slogtest/t_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestIgnoreErrors(t *testing.T) {
3939

4040
defer func() {
4141
recover()
42-
assert.Equal(t, "fatals", 0, tb.fatals)
42+
assert.Equal(t, "fatals", 1, tb.fatals)
4343
}()
4444

4545
l.Fatal(bg, "hello")

0 commit comments

Comments
 (0)