cpython: 6d61b057c375 (original) (raw)

Mercurial > cpython

changeset 98468:6d61b057c375

Closes #24884: refactored WatchedFileHandler file reopening into a separate method, based on a suggestion and patch by Marian Horban. [#24884]

Vinay Sajip <vinay_sajip@yahoo.co.uk>
date Thu, 01 Oct 2015 20:54:41 +0100
parents 757baaedc043
children 2b5357b38366
files Doc/library/logging.handlers.rst Lib/logging/handlers.py
diffstat 2 files changed, 21 insertions(+), 6 deletions(-)[+] [-] Doc/library/logging.handlers.rst 12 Lib/logging/handlers.py 15

line wrap: on

line diff

--- 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:: emit(record)

.. _base-rotating-handler:

--- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -440,11 +440,11 @@ class WatchedFileHandler(logging.FileHan sres = os.fstat(self.stream.fileno()) self.dev, self.ino = sres[ST_DEV], sres[ST_INO]

@@ -467,6 +467,15 @@ class WatchedFileHandler(logging.FileHan # open a new file handle and get new stat info from that fd self.stream = self._open() self._statstream() +

+