diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2015-10-01 19:54:41 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2015-10-01 19:54:41 (GMT) |
commit | 29a1445136c7353543b516a085c38b8be9ce5109 (patch) | |
tree | ae7d7ccce28f5a8f101839ad888b8ed66189c560 /Doc/library/logging.handlers.rst | |
parent | 14b1b486ca96745485e4c6c71eefa56372e815d3 (diff) | |
download | cpython-29a1445136c7353543b516a085c38b8be9ce5109.zip cpython-29a1445136c7353543b516a085c38b8be9ce5109.tar.gz cpython-29a1445136c7353543b516a085c38b8be9ce5109.tar.bz2 |
Closes #24884: refactored WatchedFileHandler file reopening into a separate method, based on a suggestion and patch by Marian Horban.
Diffstat (limited to 'Doc/library/logging.handlers.rst')
-rw-r--r-- | Doc/library/logging.handlers.rst | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst index 67403a9..0d3928c 100644 --- a/Doc/library/logging.handlers.rst +++ b/Doc/library/logging.handlers.rst @@ -162,11 +162,17 @@ for this value. first call to :meth:`emit`. By default, the file grows indefinitely. + .. method:: reopenIfNeeded() + + Checks to see if the file has changed. If it has, the existing stream is + flushed and closed and the file opened again, typically as a precursor to + outputting the record to the file. + + .. method:: emit(record) - Outputs the record to the file, but first checks to see if the file has - changed. If it has, the existing stream is flushed and closed and the - file opened again, before outputting the record to the file. + Outputs the record to the file, but first calls :meth:`reopenIfNeeded` to + reopen the file if it has changed. .. _base-rotating-handler: |