From f4fdd14e25593c70063c68106828c216f9a024fa Mon Sep 17 00:00:00 2001 From: masl Date: Mon, 30 Oct 2023 23:28:53 +0100 Subject: [PATCH] fix: add proper keys for logging --- web/ping/handle.go | 2 +- web/start/handle.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/ping/handle.go b/web/ping/handle.go index c9d7697..766bdb6 100644 --- a/web/ping/handle.go +++ b/web/ping/handle.go @@ -18,7 +18,7 @@ func Handle() httprouter.Handle { err := json.NewDecoder(r.Body).Decode(&p) if err != nil { - slog.Error("ping error:", err) + slog.Error("ping error", "error", err) w.WriteHeader(http.StatusBadRequest) return } diff --git a/web/start/handle.go b/web/start/handle.go index 1dabc0c..d4640ae 100644 --- a/web/start/handle.go +++ b/web/start/handle.go @@ -30,7 +30,7 @@ func Handle(store storage.Store) httprouter.Handle { return } - slog.Info("cloud created: %s", c.Id.String()) + slog.Info("cloud created", "cloud", c.Id.String()) w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK)