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 {
badRequest(resp, err.Error())
return
}
reqMsg := fmt.Sprintf("\nhandling request:\n%s\n", util.ToYAMLOrError(request))
util.LogHandlerText("expansion service", reqMsg)
response, err := backend.ExpandChart(request)
if err != nil {
badRequest(resp, fmt.Sprintf("error expanding chart: %s", err))
return
}
util.LogHandlerExit("expansion service", http.StatusOK, "OK", resp.ResponseWriter)
message := fmt.Sprintf("\nResources:\n%s\n", response.Resources)
util.LogHandlerText("expansion service", message)
respMsg := fmt.Sprintf("\nreturning response:\n%s\n", util.ToYAMLOrError(response.Resources))
util.LogHandlerText("expansion service", respMsg)
resp.WriteEntity(response)
}
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