-
Notifications
You must be signed in to change notification settings - Fork 2.5k
__name__ loggers #174
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
__name__ loggers #174
Conversation
| import datetime | ||
|
|
||
|
|
||
| logger = logging.getLogger(__name__) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Please squash commits with each round of code review. |
|
@jonparrott, what do you think of this? |
|
This is fine, but we might need to attach a nullhandler to the https://github.com/shazow/urllib3/blob/master/urllib3/__init__.py#L23 |
|
What dark sorcery is that? |
|
It's not sorcery, it's just the right thing to do: https://docs.python.org/2/howto/logging.html#configuring-logging-for-a-library |
|
Huh. Well that seems... curious. Should @emmett9001 amend his commit to satisfy that guidance? (I suspect yes; @emmett9001, what do you think?) |
|
Yes, please. |
|
Just to clarify - are you suggesting that this code should be added somewhere in my existing diff? It's not clear where this should go. |
|
Yes, it should go in |
|
See my updated diff for the |
|
Looks good, except you still need this line: https://github.com/shazow/urllib3/blob/f0d98555ce6e3eeb379a8a659dff9d7f9ff42348/urllib3/__init__.py#L53 Once that's in and you've squashed commits, this LGTM. |
|
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
Prevent breaking changes when one of dependencies updates its major version.
The original: * Violated pep8 * Used `print()` both as a statement and as a function, guaranteeing that the code won't work in either Python 2.5 or 3.x * Didn't explain anything about what was happening. This change fixes two of those problems.
|
I messed up the history by rebasing and merging master, so I've reopened a clean version of this pull request as #206. Please comment further there and close this one if you'd like. |
|
In the future please keep to one pull request for a desired change to the codebase; it makes for better forensics to have all the code review recorded in one place. |
|
Will do. My previous pull request was corrupted by a bad merge - I'll be On Tuesday, March 22, 2016, Nathaniel Manista notifications@github.com
|
Rewind original stream body when refreshing.
This pull request moves logging into loggers that are specific to the current
__name__. This allows code that uses the API client to set the logging level for the client without affecting other logging happening on the root logger.