fix: all log messages are now lower case

This commit is contained in:
Robin Dittmar
2026-07-20 21:05:18 +02:00
parent c06d008a20
commit c623e02b6c
8 changed files with 32 additions and 26 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ func DefaultHandler(w http.ResponseWriter, r *http.Request) {
resp.Form[k] = v[0]
}
} else {
slog.ErrorContext(ctx, "Error parsing form", slog.Any("error", err))
slog.ErrorContext(ctx, "error parsing form", slog.Any("error", err))
}
response.JSON(ctx, w, http.StatusOK, resp)
+5 -5
View File
@@ -18,18 +18,18 @@ func (h *ListHandler) CreateList(w http.ResponseWriter, r *http.Request) {
payload, err := request.DecodeCreateList(r)
if err != nil {
slog.ErrorContext(ctx, "Failed to decode create list payload", slog.Any("error", err))
response.Error(ctx, w, http.StatusBadRequest, "Failed to decode request body")
slog.ErrorContext(ctx, "failed to decode create list payload", slog.Any("error", err))
response.Error(ctx, w, http.StatusBadRequest, "failed to decode request body")
return
}
list, err := h.ListService.Create(ctx, payload.Name, payload.UserIDs)
if err != nil {
slog.ErrorContext(ctx, "Failed to create list", slog.Any("error", err))
response.Error(ctx, w, http.StatusInternalServerError, "Failed to create list")
slog.ErrorContext(ctx, "failed to create list", slog.Any("error", err))
response.Error(ctx, w, http.StatusInternalServerError, "failed to create list")
return
}
slog.InfoContext(ctx, "Created list successfully", slog.Any("list_id", list.ID))
slog.InfoContext(ctx, "created list successfully", slog.Any("list_id", list.ID))
response.JSON(ctx, w, http.StatusCreated, list)
}
+2 -2
View File
@@ -14,7 +14,7 @@ func JSON(ctx context.Context, w http.ResponseWriter, status int, data any) {
w.WriteHeader(http.StatusInternalServerError)
_, err := w.Write([]byte(`{"error": "internal server error: failed to marshal response"}`))
if err != nil {
slog.ErrorContext(ctx, "Failed to write JSON", slog.Any("error", err))
slog.ErrorContext(ctx, "failed to write json", slog.Any("error", err))
return
}
return
@@ -24,7 +24,7 @@ func JSON(ctx context.Context, w http.ResponseWriter, status int, data any) {
w.WriteHeader(status)
_, err = w.Write(payload)
if err != nil {
slog.ErrorContext(ctx, "Failed to write response", slog.Any("error", err))
slog.ErrorContext(ctx, "failed to write response", slog.Any("error", err))
return
}
}