diff options
author | Gibheer <gibheer+git@zero-knowledge.org> | 2023-08-17 22:05:46 +0200 |
---|---|---|
committer | Gibheer <gibheer+git@zero-knowledge.org> | 2023-08-17 22:05:46 +0200 |
commit | 8e6e01f47c320f862b9ba44815587006ba80cf77 (patch) | |
tree | cb59d7d3a3c84a4d54ac2a26e436f2b2a83cdfab /cmd/monfront/groups.go | |
parent | 10f7eb53f4370cab6c1ff390773772389d500e59 (diff) |
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.
Diffstat (limited to 'cmd/monfront/groups.go')
-rw-r--r-- | cmd/monfront/groups.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cmd/monfront/groups.go b/cmd/monfront/groups.go index 0dfa40c..ee13226 100644 --- a/cmd/monfront/groups.go +++ b/cmd/monfront/groups.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "log" "net/http" "strings" ) @@ -56,7 +55,7 @@ where maxstate = 1` if err != nil { con.w.WriteHeader(http.StatusInternalServerError) con.w.Write([]byte("problems with the database")) - log.Printf("could not get check list: %s", err) + con.log.Info("could not get check list", "error", err) return } @@ -67,7 +66,7 @@ where maxstate = 1` if err != nil { con.w.WriteHeader(http.StatusInternalServerError) con.w.Write([]byte("problems with the database")) - log.Printf("could not get check list: %s", err) + con.log.Info("could not get check list", "error", err) return } groups = append(groups, g) @@ -76,7 +75,7 @@ where maxstate = 1` if err := con.loadMappings(); err != nil { con.w.WriteHeader(http.StatusInternalServerError) con.w.Write([]byte("problem with the mappings")) - log.Printf("could not load mappings: %s", err) + con.log.Info("could not load mappings", "error", err) return } con.w.Header()["Content-Type"] = []string{"text/html"} |