diff options
author | Alan Pearce | 2024-07-01 22:15:06 +0200 |
---|---|---|
committer | Alan Pearce | 2024-07-01 22:15:06 +0200 |
commit | 94b21b286edff37496a2fe481963625ac01c30a1 (patch) | |
tree | bdfd7803dd4eb22da785331b8547ff9858e2b0e6 /internal/server/error.go | |
parent | f076b5bd6cb82edd99be50f3dbdd39bb9be2c44e (diff) | |
download | searchix-94b21b286edff37496a2fe481963625ac01c30a1.tar.lz searchix-94b21b286edff37496a2fe481963625ac01c30a1.tar.zst searchix-94b21b286edff37496a2fe481963625ac01c30a1.zip |
feat: more structured logging
Diffstat (limited to 'internal/server/error.go')
-rw-r--r-- | internal/server/error.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/server/error.go b/internal/server/error.go index d9d6778..1e04bbc 100644 --- a/internal/server/error.go +++ b/internal/server/error.go @@ -1,15 +1,16 @@ package server import ( - "log/slog" "net/http" "go.alanpearce.eu/searchix/internal/components" "go.alanpearce.eu/searchix/internal/config" + "go.alanpearce.eu/x/log" ) func createErrorHandler( config *config.Config, + log *log.Logger, ) func(http.ResponseWriter, *http.Request, string, int) { return func(w http.ResponseWriter, r *http.Request, message string, code int) { var err error @@ -31,7 +32,7 @@ func createErrorHandler( err = components.ErrorPage(indexData).Render(r.Context(), w) } if err != nil { - slog.Error( + log.Error( "error rendering error page template", "error", err, |