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

Sebastian Spaeth Sebastian at SSpaeth.de
Fri Oct 28 08:27:53 BST 2011


TLDR; All UI backends have been converted to use python's logging
module. The only one that still suffers from some stability issues is
blinkenlights.

Dear all,

the current home-grown logging framework had problems. E.g. we had reports that
output is not flushed and missing. Also, we had no easy way to add
timestamps to the log file while keeping uncluttered output on the
console etc.

I have now pushed a horribly big rework patch to my next branch which
makes use of python's "logging" module to do the logging. This allows us
to do e.g. different formatting for console and file output (file output
now has e.g. timestamps, and have less clutter when using the TTYUI ui).

It works fine for all UI backends, but Blinkenlights. This finally
required me to dive into the Blinkenlights code for the very first
time. It's code looked somewhat like:

 s.af[tf] = s.c.ts.gettf()

without any code documentation, of course. It was quite a challenge,
given that the curses module on python is not nicely documented anyway
(and I don't have experience with it). But I think I have a grasp of
what the code does, and I have been adding comments and renaming
variables to make more sense. But this is still somewhat work in
progress. As a result, the blinkenlights interface will still not behave
nicely, if you press e.g. 'q' to quit (ctrl-c works fine though).

I am now using the blinkenlights UI myself to spot and work on things, I
am pretty confident that I can get it working nicely again before the
next stable release.

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20111028/25798289/attachment.sig>


More information about the OfflineIMAP-project mailing list