diff options
author | Jochem Boersma <jochem.boersma@witteveenbos.com> | 2023-07-22 20:43:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-22 20:43:18 (GMT) |
commit | 5e5a34ac3a827e040cd89426b1774fec2123336a (patch) | |
tree | c822a49fbf154ccc2834d93fd6bbf0c82b261957 | |
parent | 22422e9d1a50b4970bc6957a88569618d579c47f (diff) | |
download | cpython-5e5a34ac3a827e040cd89426b1774fec2123336a.zip cpython-5e5a34ac3a827e040cd89426b1774fec2123336a.tar.gz cpython-5e5a34ac3a827e040cd89426b1774fec2123336a.tar.bz2 |
gh-107028: tiny textual changes in logging docs and docstrings (GH-107029)
-rw-r--r-- | Doc/library/logging.handlers.rst | 9 | ||||
-rw-r--r-- | Lib/logging/handlers.py | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst index 47bfe4f..72e5ffb 100644 --- a/Doc/library/logging.handlers.rst +++ b/Doc/library/logging.handlers.rst @@ -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) @@ -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) diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 9847104..671cc95 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -1399,7 +1399,7 @@ class MemoryHandler(BufferingHandler): 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: |