mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser.
This commit is contained in:
parent
31f30b17fe
commit
aa672ebe49
1 changed files with 22 additions and 3 deletions
|
@ -1534,8 +1534,6 @@ subclasses. However, the :meth:`__init__` method in subclasses needs to call
|
||||||
StreamHandler
|
StreamHandler
|
||||||
^^^^^^^^^^^^^
|
^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. module:: logging.handlers
|
|
||||||
|
|
||||||
The :class:`StreamHandler` class, located in the core :mod:`logging` package,
|
The :class:`StreamHandler` class, located in the core :mod:`logging` package,
|
||||||
sends logging output to streams such as *sys.stdout*, *sys.stderr* or any
|
sends logging output to streams such as *sys.stdout*, *sys.stderr* or any
|
||||||
file-like object (or, more precisely, any object which supports :meth:`write`
|
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
|
||||||
Outputs the record to the file.
|
Outputs the record to the file.
|
||||||
|
|
||||||
|
|
||||||
|
NullHandler
|
||||||
|
^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionadded:: 3.1
|
||||||
|
|
||||||
|
The :class:`NullHandler` class, located in the core :mod:`logging` package,
|
||||||
|
does not do any formatting or output. It is essentially a "no-op" handler
|
||||||
|
for use by library developers.
|
||||||
|
|
||||||
|
|
||||||
|
.. class:: NullHandler()
|
||||||
|
|
||||||
|
Returns a new instance of the :class:`NullHandler` class.
|
||||||
|
|
||||||
|
|
||||||
|
.. method:: emit(record)
|
||||||
|
|
||||||
|
This method does nothing.
|
||||||
|
|
||||||
WatchedFileHandler
|
WatchedFileHandler
|
||||||
^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. module:: logging.handlers
|
||||||
|
|
||||||
The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
|
The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
|
||||||
module, is a :class:`FileHandler` which watches the file it is logging to. If
|
module, is a :class:`FileHandler` which watches the file it is logging to. If
|
||||||
the file changes, it is closed and reopened using the file name.
|
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
|
||||||
sections called ``[loggers]``, ``[handlers]`` and ``[formatters]``
|
sections called ``[loggers]``, ``[handlers]`` and ``[formatters]``
|
||||||
which identify by name the entities of each type which are defined in
|
which identify by name the entities of each type which are defined in
|
||||||
the file. For each such entity, there is a separate section which
|
the file. For each such entity, there is a separate section which
|
||||||
identified how that entity is configured. Thus, for a logger named
|
identifies how that entity is configured. Thus, for a logger named
|
||||||
``log01`` in the ``[loggers]`` section, the relevant configuration
|
``log01`` in the ``[loggers]`` section, the relevant configuration
|
||||||
details are held in a section ``[logger_log01]``. Similarly, a handler
|
details are held in a section ``[logger_log01]``. Similarly, a handler
|
||||||
called ``hand01`` in the ``[handlers]`` section will have its
|
called ``hand01`` in the ``[handlers]`` section will have its
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue