Skip to content

gh-107028: tiny textual changes in logging docs and docstrings #107029

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

Merged
merged 8 commits 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 @@ -917,8 +917,9 @@ should, then :meth:`flush` is expected to do the flushing.

.. 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 @@ should, then :meth:`flush` is expected to do the flushing.

.. 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