Open ewilde opened 5 years ago
I'm not against this at all, but perhaps a better DX might be simply adding the error message to the output.
Rather than Function 'echo' failed to deploy with status code: 400
Function 'echo' failed to deploy. Bad Request. Message: 'Please provide a valid route /function/function_name.'
That would be in addition to your suggestion for the --debug
command. Perhaps -v
--verbose
instead?
It would be good to be able to also get the full request and response output to diagnose an issue better. Generally speaking, at least from my experience, just having the error message returned would greatly improve the experience.
@burtonr apologies if it wasn’t clear, my proposal is to add full request/response logging with debug
flag
I can see how this might be useful, but what about using a simple intercepting proxy instead?
You'll get complete logs of request and response with the ability to replay etc.
@alexellis I agree that at the CLI level this can be achieved with a proxy. I mentioned this in the issue under ‘alternatives’.
Couple of draw backs:
Hi what about https://mitmproxy.org/ ?
During provider development i've found it helpful to log the the entire request/response sent from the CLI to the gateway.
Expected Behaviour
faas cli deploy --debug
Current behaviour
Future behaviour with debug flag
I have a private fork with the above functionality, if it's something the community wants I can PR it in / or adapt based on feedback.
Alternatives
Extensions
X-OpenFaaS-Trace
to gateways / provider which could debug log request/response as each hop