From 8e6e01f47c320f862b9ba44815587006ba80cf77 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Thu, 17 Aug 2023 22:05:46 +0200 Subject: switch from log to slog This commit replaces the various log entry points with a common logger provided via context. This is helpful as it groups all log entries together via the txid and should help in the future when debugging cascading errors. --- cmd/monfront/authenticater.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cmd/monfront/authenticater.go') diff --git a/cmd/monfront/authenticater.go b/cmd/monfront/authenticater.go index 8453264..e43c6b2 100644 --- a/cmd/monfront/authenticater.go +++ b/cmd/monfront/authenticater.go @@ -7,7 +7,6 @@ import ( "database/sql" "encoding/base64" "fmt" - "log" "net/http" "strings" "time" @@ -84,7 +83,7 @@ func (a *Authenticator) Handler() (func(*Context) error, error) { } p := pwHash{} if err := p.Parse(found); err != nil { - log.Printf("could not parse hash for user '%s': %s", user, err) + c.log.Warn("could not parse hash for user", "user", user, "error", err) return a.Unauthorized(c) } if ok, err := p.compare(pass); err != nil { -- cgit v1.2.3-70-g09d2