Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db83c8f

Browse filesBrowse files
authored
Merge pull request #798 from userlerueda/patch-1
Update logging.rst
2 parents a0b6fc8 + f20a2f6 commit db83c8f
Copy full SHA for db83c8f

File tree

Expand file treeCollapse file tree

1 file changed

+1
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-10
lines changed

‎docs/writing/logging.rst

Copy file name to clipboardExpand all lines: docs/writing/logging.rst
+1-10Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,8 @@ this in your ``__init__.py``
5555

5656
.. code-block:: python
5757
58-
# Set default logging handler to avoid "No handler found" warnings.
5958
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-
59+
logging.getLogger(__name__).addHandler(logging.NullHandler())
6960
7061
7162
Logging in an Application

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.