Skip to content

Commit 9875b17

Browse files
[3.11] gh-107028: tiny textual changes in logging docs and docstrings (GH-107029) (GH-107066)
(cherry picked from commit 5e5a34a)
1 parent 2895dbd commit 9875b17

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Doc/library/logging.handlers.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,9 @@ should, then :meth:`flush` is expected to do the flushing.
917917

918918
.. method:: flush()
919919

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

923924

924925
.. method:: shouldFlush(record)
@@ -950,9 +951,9 @@ should, then :meth:`flush` is expected to do the flushing.
950951

951952
.. method:: flush()
952953

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

957958

958959
.. method:: setTarget(target)

Lib/logging/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ def flush(self):
13991399
records to the target, if there is one. Override if you want
14001400
different behaviour.
14011401
1402-
The record buffer is also cleared by this operation.
1402+
The record buffer is only cleared if a target has been set.
14031403
"""
14041404
self.acquire()
14051405
try:

0 commit comments

Comments
 (0)