diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2004-07-12 09:21:41 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2004-07-12 09:21:41 (GMT) |
commit | 5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab (patch) | |
tree | 6c48258a1fa814806d3031c2e94668602b82bab1 /Lib/logging/handlers.py | |
parent | 1869df11544b49dadccfd28c9b0778fb456ce36c (diff) | |
download | cpython-5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab.zip cpython-5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab.tar.gz cpython-5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab.tar.bz2 |
Removed debugging print statements from TimedRotatingFileHandler, and sorted list returned by glob.glob() (SF #987166)
Diffstat (limited to 'Lib/logging/handlers.py')
-rw-r--r-- | Lib/logging/handlers.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 718c04d..d9de952 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -224,7 +224,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler): daysToWait = (6 - self.dayOfWeek) + day self.rolloverAt += (daysToWait * (60 * 60 * 24)) - print "Will rollover at %d, %d seconds from now" % (self.rolloverAt, self.rolloverAt - currentTime) + #print "Will rollover at %d, %d seconds from now" % (self.rolloverAt, self.rolloverAt - currentTime) def shouldRollover(self, record): """ @@ -236,7 +236,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler): t = int(time.time()) if t >= self.rolloverAt: return 1 - print "No need to rollover: %d, %d" % (t, self.rolloverAt) + #print "No need to rollover: %d, %d" % (t, self.rolloverAt) return 0 def doRollover(self): @@ -259,8 +259,9 @@ class TimedRotatingFileHandler(BaseRotatingHandler): # find the oldest log file and delete it s = glob.glob(self.baseFilename + ".20*") if len(s) > self.backupCount: + s.sort() os.remove(s[0]) - print "%s -> %s" % (self.baseFilename, dfn) + #print "%s -> %s" % (self.baseFilename, dfn) self.stream = open(self.baseFilename, "w") self.rolloverAt = int(time.time()) + self.interval |