From 8a9f465d0b93487ec0adcbda6f146d5f2b771606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sat, 14 Nov 2020 18:27:20 +0100 Subject: [PATCH] add log to http utils. --- internal/utils/http.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/utils/http.go b/internal/utils/http.go index 0ec6d255..901e86b9 100644 --- a/internal/utils/http.go +++ b/internal/utils/http.go @@ -4,6 +4,8 @@ import ( "fmt" "net/http" "encoding/json" + + "github.com/rs/zerolog/log" ) type ErrResponse struct { @@ -24,8 +26,9 @@ func HttpJsonResponse(w http.ResponseWriter, status int, res interface{}) { w.WriteHeader(status) if err := json.NewEncoder(w).Encode(res); err != nil { - // TODO: Log. - //log.Warn().Err(err).Msg("failed writing json error response") + log.Warn().Err(err). + Str("module", "http"). + Msg("failed writing json error response") } }