Skip to content

Instantly share code, notes, and snippets.

@mbeale
Created March 25, 2013 19:40
Show Gist options
  • Save mbeale/5239985 to your computer and use it in GitHub Desktop.
Save mbeale/5239985 to your computer and use it in GitHub Desktop.
Add Basic logging to Recurly python client library
#add this after adding your api key, before you make any calls to the API
log = logging.getLogger('recurly.http.response')
log.setLevel(logging.DEBUG)
#create console handler and set level to debug
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
#create formatter
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
#add formatter to ch
ch.setFormatter(formatter)
#add ch to logger
log.addHandler(ch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment