-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Avoid generating 'No handlers could be found for logger "elasticsearch"' errors ... #169
Conversation
…h"' errors by installing no-op logging handler per <https://docs.python.org/2/howto/logging.html#configuring-logging-for-a-library>.
This addresses #67. |
Travis CI said:
However, the
The build should not be failing. |
Duh. Travis CI uses Python 2.6 to build this module, and |
Python 2.6 does not define logging.NullHandler.
I am wondering why do you prefer the silencing approach instead of the default behavior. The message might be irritating for some people but I find it helps a lot of people discover that there is such a thing as logging and that our library uses it. The HOWTO you linked specifies:
Thanks! |
My main concern is the odd That said, your implicit reference to the Python 3 version of the HOWTO hints at Python 3.2+ behavior actually being different from 2.x/3.0/3.1 behavior:
This means under Python 3.2+ a |
I still don't honestly see the reason for adding this code just to avoid the The HOWTO explicitly states that providing no configuration is regarded as best default behavior and suggest adding the |
When you say "The HOWTO explicitly states that providing no configuration is regarded as best default behavior", then that's true only for Python 3.2+, since 3.2+ does not generate said error message. Python 2.x does, and the Python 2.7 HOWTO explicitly suggests a way for libraries to avoid generating said error message. If you can't agree with that, then I have nothing else to try to convince you. Thanks for taking the time to consider my concern anyway. |
I found that most people don't share my view on this, thank you for your patience! This was merged in 51c89a8 |
@honzakral, thanks for being accommodating about this! Happy New Year to you and @elasticsearch! |
... by installing no-op logging handler per https://docs.python.org/2/howto/logging.html#configuring-logging-for-a-library.