auth0 / Guardian.Android

Android toolkit for Auth0 Guardian API
https://auth0.com/guardian
MIT License
5 stars 18 forks source link

Add "enableLogging" method to enable logging of requests #68

Closed nikolaseu closed 7 years ago

nikolaseu commented 7 years ago

Add "enableLogging" method to Builders to enable the logging of all HTTP requests

Closes #64

nikolaseu commented 7 years ago

I wasn't planning on adding tests for this. I'm more interested on the method name and/or if I should spend more time and do something better like adding your own logger, declaring an interface or something. But this is just a debug helper and the lib is v0.x so I think it's fine

lbalmaceda commented 7 years ago

@nikolaseu The name is ok, and just logging requests/responses in a HttpLoggingInterceptor.Level.BODY level should be enough. There's no need to open the API for custom loggers IMO. What I would add is a legend in the javadoc telling that this is supposed to be used just in dev environments as it may leak sensitive information in the logcat. Regarding the tests, although being a dev-only feature, if changing your implementation to be able to test it isn't too much time consuming I would give it a try, just to be sure not to break this in the future.