From f20a2f63c46a6d57c1fe00c51eae6dc12704270e Mon Sep 17 00:00:00 2001 From: Luis Rueda Date: Thu, 23 Feb 2017 13:48:52 -0500 Subject: [PATCH] Update logging.rst Update to include changes proposed in issue #794 --- docs/writing/logging.rst | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/docs/writing/logging.rst b/docs/writing/logging.rst index 9b41aba..ad2bda1 100644 --- a/docs/writing/logging.rst +++ b/docs/writing/logging.rst @@ -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