Created
March 25, 2013 19:40
-
-
Save mbeale/5239985 to your computer and use it in GitHub Desktop.
Add Basic logging to Recurly python client library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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