Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa672eb

Browse files
committed
Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser.
1 parent 31f30b1 commit aa672eb

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

Doc/library/logging.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,8 +1534,6 @@ subclasses. However, the :meth:`__init__` method in subclasses needs to call
15341534
StreamHandler
15351535
^^^^^^^^^^^^^
15361536

1537-
.. module:: logging.handlers
1538-
15391537
The :class:`StreamHandler` class, located in the core :mod:`logging` package,
15401538
sends logging output to streams such as *sys.stdout*, *sys.stderr* or any
15411539
file-like object (or, more precisely, any object which supports :meth:`write`
@@ -1591,9 +1589,30 @@ sends logging output to a disk file. It inherits the output functionality from
15911589
Outputs the record to the file.
15921590

15931591

1592+
NullHandler
1593+
^^^^^^^^^^^
1594+
1595+
.. versionadded:: 3.1
1596+
1597+
The :class:`NullHandler` class, located in the core :mod:`logging` package,
1598+
does not do any formatting or output. It is essentially a "no-op" handler
1599+
for use by library developers.
1600+
1601+
1602+
.. class:: NullHandler()
1603+
1604+
Returns a new instance of the :class:`NullHandler` class.
1605+
1606+
1607+
.. method:: emit(record)
1608+
1609+
This method does nothing.
1610+
15941611
WatchedFileHandler
15951612
^^^^^^^^^^^^^^^^^^
15961613

1614+
.. module:: logging.handlers
1615+
15971616
The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
15981617
module, is a :class:`FileHandler` which watches the file it is logging to. If
15991618
the file changes, it is closed and reopened using the file name.
@@ -2306,7 +2325,7 @@ based on :mod:`configparser` functionality. The file must contain
23062325
sections called ``[loggers]``, ``[handlers]`` and ``[formatters]``
23072326
which identify by name the entities of each type which are defined in
23082327
the file. For each such entity, there is a separate section which
2309-
identified how that entity is configured. Thus, for a logger named
2328+
identifies how that entity is configured. Thus, for a logger named
23102329
``log01`` in the ``[loggers]`` section, the relevant configuration
23112330
details are held in a section ``[logger_log01]``. Similarly, a handler
23122331
called ``hand01`` in the ``[handlers]`` section will have its

0 commit comments

Comments
 (0)