]> granicus.if.org Git - python/commitdiff
Issue #9512: Made comment more informative.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Sun, 22 Aug 2010 18:11:02 +0000 (18:11 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Sun, 22 Aug 2010 18:11:02 +0000 (18:11 +0000)
Lib/logging/handlers.py

index 5f838e57e573b08f30dbe2f7d24b69f7ea75b571..906df16814a1f0d47b8581077654e1ceec483712 100644 (file)
@@ -103,8 +103,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