I would like a way to turn on logging of every http request and response for development and debug purposes.
any updates on this?
thanks.
@explicitcall: No updates yet, but we're starting to discuss a more flexible network stack that would make it easy to add logging as well. If you're interested, please join #ios-core on the Apollo Slack.
Bump
Bump
Try CFNetwork Diagnostic Logging for development. The CFNETWORK_DIAGNOSTICS environment variable lets you configure verbosity (0, 1, 2, or 3).
CFNetwork Diagnostic logging as mentioned above, Charles Proxy, or MITM proxy are great workarounds until we get to this.
But yes adding this at the lib level would be real helpful.
With the changes in 0.11.0, you should now be able to hook in to both the request as it's about to go out so you can log it and/or change it, as well as the raw response data from the URLSession. Please see the new HTTPNetworkTransportDelegate and its various sub-protocols to see where you can hook into these callbacks.
I'm gonna close this out since I think this should give anyone who wants to log these requests the information they need, and also allow them to use their logging tool of choice rather than something bolted on to Apollo. Please feel free to open new issues if you feel like there are use cases I've missed out on here!
Most helpful comment
@explicitcall: No updates yet, but we're starting to discuss a more flexible network stack that would make it easy to add logging as well. If you're interested, please join
#ios-coreon the Apollo Slack.