Update logging.rst

Update to include changes proposed in issue #794
This commit is contained in:
Luis Rueda
2017-02-23 13:48:52 -05:00
committed by GitHub
parent 2136f4b7cf
commit f20a2f63c4
+1 -10
View File
@@ -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