New logging framework on 'next' (Blinkenlights users beware)

Chris Dennis cgdennis at
Tue Nov 1 17:30:50 GMT 2011

On 10/31/2011 07:02 PM, Chris Dennis wrote:
> On 10/28/2011 08:27 AM, Sebastian Spaeth wrote:
>> All UI backends have been converted to use python's logging
>> module.
> Excellent! I've just got that working, and it's a big improvement.

...except that the log file gets overwritten every time offlineimap is 
restarted.  Maybe some people would want it to do that, but for me, the 
following 1-character patch fixes it:

diff --git a/offlineimap/ui/ b/offlineimap/ui/
index 44c920f..75cb313 100644
--- a/offlineimap/ui/
+++ b/offlineimap/ui/
@@ -81,7 +81,7 @@ class UIBase(object):

      def setlogfile(self, logfile):
          """Create file handler which logs to file"""
-        fh = logging.FileHandler(logfile, 'wt')
+        fh = logging.FileHandler(logfile, 'at')
          file_formatter = logging.Formatter("%(asctime)s %(levelname)s: "
                           "%(message)s", '%Y-%m-%d %H:%M:%S')



Chris Dennis                                  cgdennis at
Fordingbridge, Hampshire, UK

More information about the OfflineIMAP-project mailing list