Skip to content

Commit

Permalink
Fix race with using DefaultLogger (#304)
Browse files Browse the repository at this point in the history
DefaultLogger is a shared global, so sometimes this test will fail if
the other tests happen to run in an incantation that changes the logger
at the same time.
  • Loading branch information
sethvargo authored Feb 20, 2024
1 parent 8fd41bb commit 4320ff5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ func TestLogLevelVar(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

logger := logging.DefaultLogger()
logger := logging.New(io.Discard, slog.LevelInfo, logging.FormatText, false)

set := NewFlagSet()
f := set.NewSection("FLAGS")
Expand Down

0 comments on commit 4320ff5

Please sign in to comment.