Skip to content

Commit

Permalink
chore: logger with config (#717)
Browse files Browse the repository at this point in the history
  • Loading branch information
fracasula authored Jan 15, 2025
1 parent d59a83f commit d5c4932
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions maxprocs/maxprocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ func init() {
}

func setDefault() {
SetWithConfig(config.New(config.WithEnvPrefix("MAXPROCS")),
WithLogger(logger.NewLogger().Child("maxprocs")),
)
c := config.New(config.WithEnvPrefix("MAXPROCS"))
l := logger.NewFactory(c).NewLogger().Child("maxprocs")
SetWithConfig(c, WithLogger(l))
}

type conf struct {
Expand Down
1 change: 1 addition & 0 deletions maxprocs/maxprocs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ func TestEnvironmentVariables(t *testing.T) {
before := runtime.GOMAXPROCS(0)
defer runtime.GOMAXPROCS(before)

t.Setenv("MAXPROCS_LOGGER_CONSOLE_JSON_FORMAT", "true")
t.Setenv("MAXPROCS_REQUESTS", "1100m")

setDefault()
Expand Down

0 comments on commit d5c4932

Please sign in to comment.