Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wdbaruni committed Oct 7, 2024
1 parent 58566b0 commit 8d5afa1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ func init() { //nolint:gochecknoinits
strings.HasSuffix(os.Args[0], ".test") ||
flag.Lookup("test.v") != nil ||
flag.Lookup("test.run") != nil {
ConfigureLogging(LogModeDefault, zerolog.DebugLevel)
ConfigureLoggingLevel(zerolog.DebugLevel)
configureLogging(defaultLogging())
return
}

Expand Down
9 changes: 3 additions & 6 deletions pkg/logger/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ func TestConfigureLogging(t *testing.T) {
})

var logging strings.Builder
writer := zerolog.NewConsoleWriter(func(w *zerolog.ConsoleWriter) {
ConfigureLoggingLevel(zerolog.InfoLevel)
configureLogging(zerolog.NewConsoleWriter(func(w *zerolog.ConsoleWriter) {
defaultLogFormat(w)
w.Out = &logging
w.NoColor = true
})

// Configure logging with the test writer
ConfigureLogging(LogModeDefault, zerolog.InfoLevel)
configureLogging(writer)
}))

subsubpackage.TestLog("testing error logging", "testing message")

Expand Down

0 comments on commit 8d5afa1

Please sign in to comment.