We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a0b6fc8 + f20a2f6 commit db83c8fCopy full SHA for db83c8f
docs/writing/logging.rst
@@ -55,17 +55,8 @@ this in your ``__init__.py``
55
56
.. code-block:: python
57
58
- # Set default logging handler to avoid "No handler found" warnings.
59
import logging
60
- try: # Python 2.7+
61
- from logging import NullHandler
62
- except ImportError:
63
- class NullHandler(logging.Handler):
64
- def emit(self, record):
65
- pass
66
-
67
- logging.getLogger(__name__).addHandler(NullHandler())
68
+ logging.getLogger(__name__).addHandler(logging.NullHandler())
69
70
71
Logging in an Application
0 commit comments