[Zope-Coders] Wrapping lines in zLOG?

Guido van Rossum guido@python.org
Mon, 16 Sep 2002 23:40:00 -0400


I've had the, um, pleasure of having to stare at log files generated
by zLOG a lot lately.  I really hate to look at long lines that are
wrapped without respect for word boundaries, and I equally hate having
to stretch my Emacs window to view files with such long lines.

So I added a text wrapping feature to zLOG/MinimalLogger.py.  It uses
the textwrap module which is available only in CVS Python (aka Python
2.3).  With wrapping, the log file looks like this:

------
2002-09-16T23:36:33 INFO(0) testZEO setUp()
                    ZEO.tests.testZEO.UnixConnectionTests.check666
------
2002-09-16T23:36:33 INFO(0) StorageServer:3529 StorageServer (pid=3538) created
                    RW with storages: 1:RW
------
2002-09-16T23:36:33 INFO(0) ClientStorage:3529 ClientStorage (pid=3529) created
                    RW/normal for storage: '1'
------

(Without wrapping, it looked like this:

------
2002-09-16T23:36:33 INFO(0) testZEO setUp() ZEO.tests.testZEO.UnixConnectionTests.check666
------
2002-09-16T23:36:33 INFO(0) StorageServer:3529 StorageServer (pid=3538) created RW with storages: 1:RW
------
2002-09-16T23:36:33 INFO(0) ClientStorage:3529 ClientStorage (pid=3529) created RW/normal for storage: '1'
------

)

But there are also downsides to the wrapping (I'm sure you can think
of some).

All in all, do people prefer the wrapped or the unwrapped form?

--Guido van Rossum (home page: http://www.python.org/~guido/)