[Patches] [ python-Patches-921318 ] Patch for Vinay Sajip's Python-logging package

SourceForge.net noreply at sourceforge.net
Mon Mar 22 14:58:26 EST 2004


Patches item #921318, was opened at 2004-03-22 11:58
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=921318&group_id=5470

Category: None
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Mark E. Davidson (medavidson)
Assigned to: Nobody/Anonymous (nobody)
Summary: Patch for Vinay Sajip's Python-logging package

Initial Comment:
This is a patch for Vinay Sajip's Python-logging
package.  It adds the support for time-based log
rollovers.  Specifically, it adds a new handler called
TimedRotatingFIleHandler.  TimedRotatingFileHandler
works just like the existing RotatingFileHandler,
except that instead of rolling over when the log file
hits a certain size, it rolls over when a time-interval
has occurred.

You can have the log files rollover ever <n> seconds,
minutes, hours, days.  You can have log files rollover
at midnight.  Log files can also roll over on a day of
the week.

The name of the log file is customized to fit the
interval specified.  In other words, it&#039;s suffix is
changed to match the interval you asked for.  If you
asked for it to roll over every hour, then the log file
has a suffix with the year, month, day and hour, but if
you roll over on a certain minute, then the suffix also
has the minute.

I had an extended correspondence with Vinay about this
code as I was writing it, so he knows it&#039;s coming.

It&#039;s been mostly tested, but not every variation has
been exercised.  The rollovers at seconds, minutes,
hours have been exercised, as well as the midnight
rollover, but the not the day of week.  Additionally,
the backupCount variation of the
TimedRotatingFileHandler is somewhat simplistic and not
well tested.

This patch only affects handlers.py.  It does NOT patch
the graphical TkInter-based log configuration utility,
as I ran out of time to work on this and Vinay said he
might change the class layout.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=921318&group_id=5470



More information about the Patches mailing list