-
Notifications
You must be signed in to change notification settings - Fork 2
Avoid using global logger #15
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
Conversation
Thanks a lot, I will merge and make a release in a couple of days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW a very common pattern here is to have
logger = logging.getLogger(__name__)
at the beginning of the file and then use logger
in the rest of the file. :)
The only things I don't understand, yet is why this line:
brokes mitmproxy, and rewrite it into:
or
doesn't broke it. |
Aha! The call |
The commit in question had removed it :) 650121d#diff-fb2e5a842fd78374e92b5bd2034fcfd0a8a1b25488f23c906abcd4326d2ae410 |
https://docs.python.org/3/library/logging.html and https://docs.python.org/3/howto/logging.html both recommend |
I wasn't aware that |
It fixes mitmproxy/mitmproxy#7680 for example
@ThirVondukr now it should pass lint |
Somehow it fixes mitmproxy/mitmproxy#7680