Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions docs/writing/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,8 @@ this in your ``__init__.py``

.. code-block:: python

# Set default logging handler to avoid "No handler found" warnings.
import logging
try: # Python 2.7+
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass

logging.getLogger(__name__).addHandler(NullHandler())

logging.getLogger(__name__).addHandler(logging.NullHandler())


Logging in an Application
Expand Down