Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.12] gh-107028: tiny textual changes in logging docs and docstrings (GH-107029) #107065

Merged
merged 1 commit into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Doc/library/logging.handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
StreamHandler
^^^^^^^^^^^^^

The :class:`StreamHandler` class, located in the core :mod:`logging` package,

Check warning on line 35 in Doc/library/logging.handlers.rst

View workflow job for this annotation

GitHub Actions / Docs

py:meth reference target not found: write

Check warning on line 35 in Doc/library/logging.handlers.rst

View workflow job for this annotation

GitHub Actions / Docs

py:meth reference target not found: flush
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`
and :meth:`flush` methods).
Expand All @@ -55,7 +55,7 @@

.. method:: flush()

Flushes the stream by calling its :meth:`flush` method. Note that the

Check warning on line 58 in Doc/library/logging.handlers.rst

View workflow job for this annotation

GitHub Actions / Docs

py:meth reference target not found: close
:meth:`close` method is inherited from :class:`~logging.Handler` and so
does no output, so an explicit :meth:`flush` call may be needed at times.

Expand Down Expand Up @@ -95,7 +95,7 @@

.. class:: FileHandler(filename, mode='a', encoding=None, delay=False, errors=None)

Returns a new instance of the :class:`FileHandler` class. The specified file is

Check warning on line 98 in Doc/library/logging.handlers.rst

View workflow job for this annotation

GitHub Actions / Docs

py:const reference target not found: 'a'
opened and used as the stream for logging. If *mode* is not specified,
:const:`'a'` is used. If *encoding* is not ``None``, it is used to open the file
with that encoding. If *delay* is true, then file opening is deferred until the
Expand Down Expand Up @@ -160,7 +160,7 @@

.. currentmodule:: logging.handlers

The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`

Check warning on line 163 in Doc/library/logging.handlers.rst

View workflow job for this annotation

GitHub Actions / Docs

py:class reference target not found: FileHandler
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.

Expand All @@ -180,7 +180,7 @@

.. class:: WatchedFileHandler(filename, mode='a', encoding=None, delay=False, errors=None)

Returns a new instance of the :class:`WatchedFileHandler` class. The specified

Check warning on line 183 in Doc/library/logging.handlers.rst

View workflow job for this annotation

GitHub Actions / Docs

py:const reference target not found: 'a'
file is opened and used as the stream for logging. If *mode* is not specified,
:const:`'a'` is used. If *encoding* is not ``None``, it is used to open the file
with that encoding. If *delay* is true, then file opening is deferred until the
Expand Down Expand Up @@ -221,7 +221,7 @@

.. class:: BaseRotatingHandler(filename, mode, encoding=None, delay=False, errors=None)

The parameters are as for :class:`FileHandler`. The attributes are:

Check warning on line 224 in Doc/library/logging.handlers.rst

View workflow job for this annotation

GitHub Actions / Docs

py:class reference target not found: FileHandler

.. attribute:: namer

Expand Down Expand Up @@ -289,7 +289,7 @@

.. versionadded:: 3.3

The reason the attributes exist is to save you having to subclass - you can use

Check warning on line 292 in Doc/library/logging.handlers.rst

View workflow job for this annotation

GitHub Actions / Docs

py:meth reference target not found: emit

Check warning on line 292 in Doc/library/logging.handlers.rst

View workflow job for this annotation

GitHub Actions / Docs

py:meth reference target not found: handleError
the same callables for instances of :class:`RotatingFileHandler` and
:class:`TimedRotatingFileHandler`. If either the namer or rotator callable
raises an exception, this will be handled in the same way as any other
Expand Down Expand Up @@ -615,7 +615,7 @@

.. class:: SysLogHandler(address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER, socktype=socket.SOCK_DGRAM)

Returns a new instance of the :class:`SysLogHandler` class intended to

Check warning on line 618 in Doc/library/logging.handlers.rst

View workflow job for this annotation

GitHub Actions / Docs

py:const reference target not found: LOG_USER
communicate with a remote Unix machine whose address is given by *address* in
the form of a ``(host, port)`` tuple. If *address* is not specified,
``('localhost', 514)`` is used. The address is used to open a socket. An
Expand Down Expand Up @@ -917,8 +917,9 @@

.. method:: flush()

You can override this to implement custom flushing behavior. This version
just zaps the buffer to empty.
For a :class:`BufferingHandler` instance, flushing means that it sets the
buffer to an empty list. This method can be overwritten to implement more useful
flushing behavior.


.. method:: shouldFlush(record)
Expand Down Expand Up @@ -950,9 +951,9 @@

.. method:: flush()

For a :class:`MemoryHandler`, flushing means just sending the buffered
For a :class:`MemoryHandler` instance, flushing means just sending the buffered
records to the target, if there is one. The buffer is also cleared when
this happens. Override if you want different behavior.
buffered records are sent to the target. Override if you want different behavior.


.. method:: setTarget(target)
Expand Down
2 changes: 1 addition & 1 deletion Lib/logging/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ def flush(self):
records to the target, if there is one. Override if you want
different behaviour.

The record buffer is also cleared by this operation.
The record buffer is only cleared if a target has been set.
"""
self.acquire()
try:
Expand Down
Loading