From a84c403a6974f8fb177b98c7e8e5c4245bce1faa Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Mon, 16 Sep 2024 13:56:22 +1000 Subject: [PATCH] reduce the log spam --- server/handler/vmModify.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/handler/vmModify.go b/server/handler/vmModify.go index 1510088..b7f04f8 100644 --- a/server/handler/vmModify.go +++ b/server/handler/vmModify.go @@ -35,11 +35,12 @@ func (h *Handler) VmModify(w http.ResponseWriter, r *http.Request) { var event models.CloudEventReceived if err := json.Unmarshal(reqBody, &event); err != nil { h.Logger.Error("unable to decode json", "error", err) + prettyPrint(reqBody) http.Error(w, "Invalid JSON body", http.StatusBadRequest) return } else { h.Logger.Debug("successfully decoded JSON") - prettyPrint(event) + //prettyPrint(event) } if event.CloudEvent.Data.ConfigChanges == nil { @@ -50,7 +51,7 @@ func (h *Handler) VmModify(w http.ResponseWriter, r *http.Request) { } else { h.Logger.Debug("Received event contains config change info") configChanges = h.processConfigChanges(event.CloudEvent.Data.ConfigChanges.Modified) - prettyPrint(configChanges) + //prettyPrint(configChanges) var found = false // Only interested in vCPU or ram changes currently @@ -134,6 +135,7 @@ func (h *Handler) VmModify(w http.ResponseWriter, r *http.Request) { } else { w.WriteHeader(http.StatusAccepted) fmt.Fprintf(w, "Processed update event but no config changes were of interest\n") + prettyPrint(configChanges) } } }