8000 Set the name of the logger to twilio by john5223 · Pull Request #178 · twilio/twilio-python · GitHub
[go: up one dir, main page]

Skip to content

Set the name of the logger to twilio #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 14, 2014
Merged

Conversation

john5223
Copy link
Contributor

No description provided.

@@ -1,4 +1,5 @@
import logging
logger = logging.getLogger('twilio')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the rename?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proper python logging for a module.

Twilio is currently logging to the root log handler. If I set my application to debug mode, I might not want to see your logs. So therefore with this change you can do:

 logging.getLogger("twilio").setLevel(logging.ERROR) 

in your main application so that you can suppress twilio to only error messages.

https://docs.python.org/2/library/logging.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me, but please move the logger initialization down below the rest of the imports.

@john5223
Copy link
Contributor Author

Good to go or should I rebase to one commit?

@skimbrel
Copy link
Contributor

Works for me. Merging.

skimbrel added a commit that referenced this pull request Aug 14, 2014
Set the name of the logger to twilio
@skimbrel skimbrel merged commit 14e13f6 into twilio:master Aug 14, 2014
eq19 pushed a commit to VirtualNetworks/parser that referenced this pull request May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0