From: Vinay Sajip Date: Sun, 22 Aug 2010 18:11:02 +0000 (+0000) Subject: Issue #9512: Made comment more informative. X-Git-Tag: v2.7.1rc1~375 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8b1eafd8819bcc98d38a93a9ecfe76066c370a1;p=python Issue #9512: Made comment more informative. --- diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index cda84e7010..38beb1079b 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -108,8 +108,13 @@ class RotatingFileHandler(BaseRotatingHandler): If maxBytes is zero, rollover never occurs. """ + # If rotation/rollover is wanted, it doesn't make sense to use another + # mode. If for example 'w' were specified, then if there were multiple + # runs of the calling application, the logs from previous runs would be + # lost if the 'w' is respected, because the log file would be truncated + # on each run. if maxBytes > 0: - mode = 'a' # doesn't make sense otherwise! + mode = 'a' BaseRotatingHandler.__init__(self, filename, mode, encoding, delay) self.maxBytes = maxBytes self.backupCount = backupCount