def debug_http():
 import logging
 try:
  import http.client as http_client
 except ImportError:
  import httplib as http_client
 http_client.HTTPConnection.debuglevel = 1
 logging.basicConfig()
 logging.getLogger().setLevel(logging.DEBUG)
 requests_log = logging.getLogger(u'requests.packages.urllib3')
 requests_log.setLevel(logging.DEBUG)
 requests_log.propagate = True

def debug_http ( ) : import logging try : import http . client as http_client except ImportError : import httplib as http_client http_client . HTTPConnection . debuglevel = 1 logging . basicConfig ( ) logging . getLogger ( ) . setLevel ( logging . DEBUG ) requests_log = logging . getLogger ( u'requests.packages.urllib3' ) requests_log . setLevel ( logging . DEBUG ) requests_log . propagate = True
turns on debug logging for http traffic .