Closed #9556: Allowed specifying a time-of-day for a TimedRotatingFileHandler to rotate.

This commit is contained in:
Vinay Sajip 2013-04-12 17:04:23 +01:00
parent 8a9e38e715
commit a713079ed8
4 changed files with 73 additions and 8 deletions

View file

@ -296,7 +296,7 @@ The :class:`TimedRotatingFileHandler` class, located in the
timed intervals.
.. class:: TimedRotatingFileHandler(filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False)
.. class:: TimedRotatingFileHandler(filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False, atTime=None)
Returns a new instance of the :class:`TimedRotatingFileHandler` class. The
specified file is opened and used as the stream for logging. On rotating it also
@ -346,6 +346,12 @@ timed intervals.
If *delay* is true, then file opening is deferred until the first call to
:meth:`emit`.
If *atTime* is not ``None``, it must be a ``datetime.time`` instance which
specifies the time of day when rollover occurs, for the cases where rollover
is set to happen "at midnight" or "on a particular weekday".
.. versionchanged:: 3.4
*atTime* parameter was added.
.. method:: doRollover()