Setting debug=True when initializing API calls logging.basicConfig() which causes an existing logging setup (formats etc.) to be cleared. This is pretty bad when trying to use this module as a library.
This MR sets up debug logging without making this call and makes some additional small fixes.
Do not call logging.basicConfig(), it should be called by the user of
this library.
Get a logger instance on API object init and use it for logging.
Set up request and response printing when debug=True as described here:
https://docs.python-requests.org/en/latest/api/#api-changes
Set our logging level to DEBUG when debug=True.