-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Don't piggyback on oauthlib's log scope #85
Comments
+1. Not sure whether I prefer In either case we should make sure it is disabled by default witha null handler similar to https://github.com/idan/oauthlib/blob/master/oauthlib/common.py#L46. @shazow fancy sending a PR? |
If you want to be really hardcore, this is how you do it: https://github.com/shazow/urllib3/blob/master/urllib3/__init__.py#L29 I'm -0.5 on using a hardcoded scope because it breaks when you have multiple vendored copies of the module (e.g. requests vendors urllib3). Also, by using |
@shazow True, I like that I have just avoided doing by name since I've not looked up how to easily turn all those loggers on/off for a particular module set. Also if a logger is defined in many places that would call for a util method to init the logger, which is no problem, just have not happened yet. |
What do you mean? Defining a logger is still two lines (including the import), either way. |
Unless I am missing something every logger might need the whole
which might call for a util method create_logger(name) to do that for you. |
Nope, only the root namespace needs it. That is, if you apply settings for If you do it for If you do it for Not many people know this for some reason. Handy feature. This is why the snippet you copypasta'd is done in |
@shazow including me. Thanks that is great to know. Definitely go with the name approach then. Will refactor oauthlib to do the same in due time. |
This happens here and possibly other places:
This is bad because all the logs show up as coming from oauthlib, whereas some happen actually in oauthlib and some in requests_oauthlib. Differentiating them would be useful for debugging where things are happening.
I suggest using...
This will also allow the user to turn off oauthlib logs but keep requests_oauthlib logs, and vice versa.
The text was updated successfully, but these errors were encountered: