Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
Fix usage of slog
Browse files Browse the repository at this point in the history
  • Loading branch information
fsouza committed Jul 7, 2023
1 parent ab9481b commit 69ba7e9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ func (c *Config) uploader() (uploader.Uploader, error) {

func (c *Config) logger() *slog.Logger {
levels := map[string]slog.Level{
"debug": slog.DebugLevel,
"info": slog.InfoLevel,
"warning": slog.WarnLevel,
"warn": slog.WarnLevel,
"error": slog.ErrorLevel,
"debug": slog.LevelDebug,
"info": slog.LevelInfo,
"warning": slog.LevelWarn,
"warn": slog.LevelWarn,
"error": slog.LevelError,
}
opts := slog.HandlerOptions{Level: levels[c.LogLevel]}
return slog.New(opts.NewTextHandler(os.Stderr))
return slog.New(slog.NewTextHandler(os.Stderr, &opts))
}

func healthcheck(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 69ba7e9

Please sign in to comment.