Commit c245006d authored by jackgr's avatar jackgr

Add expansion request and response logging

parent 242ad69d
...@@ -49,14 +49,18 @@ func NewService(address string, port int, backend Expander) *Service { ...@@ -49,14 +49,18 @@ func NewService(address string, port int, backend Expander) *Service {
badRequest(resp, err.Error()) badRequest(resp, err.Error())
return return
} }
reqMsg := fmt.Sprintf("\nhandling request:\n%s\n", util.ToYAMLOrError(request))
util.LogHandlerText("expansion service", reqMsg)
response, err := backend.ExpandChart(request) response, err := backend.ExpandChart(request)
if err != nil { if err != nil {
badRequest(resp, fmt.Sprintf("error expanding chart: %s", err)) badRequest(resp, fmt.Sprintf("error expanding chart: %s", err))
return return
} }
util.LogHandlerExit("expansion service", http.StatusOK, "OK", resp.ResponseWriter) util.LogHandlerExit("expansion service", http.StatusOK, "OK", resp.ResponseWriter)
message := fmt.Sprintf("\nResources:\n%s\n", response.Resources) respMsg := fmt.Sprintf("\nreturning response:\n%s\n", util.ToYAMLOrError(response.Resources))
util.LogHandlerText("expansion service", message) util.LogHandlerText("expansion service", respMsg)
resp.WriteEntity(response) resp.WriteEntity(response)
} }
webService.Route( webService.Route(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment