reduce the log spam
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user