[Twisted-Python] Re: Addition to twisted.python.logfile

Moshe Zadka twisted at moshez.org
Fri Oct 18 05:52:36 MDT 2002


On Fri, 18 Oct 2002, John Abel <john.abel at pa.press.net> wrote:
 
> Enclosed is an updated logfile.py, with zlib detection - If zlib isn't
> imported, compression is turned off.  Please feel to free to
> include/tidy up as appropriate.  I've tested the example rotatelog
> script with the new logfile.py, on a 10MB file, and it takes around 6-8
> seconds to compress, on my laptop (P3-700, 256MB, Mandrake9, Python
> 2.2.2).

A few comments

1. Please get your mailer to not word-wrap in patches.
2. In general, you should submit patches from inside the CVS working
   copy, not from the installed version
3. As I read your patch, this means that a Twisted server would be
   unresponsive for 6 seconds while it is compressing. This is, in general,
   unacceptable.
4. Perhaps it would be better to use the "gzip" program, via the process
   API. A simple way to hook into logfile.py so we could add a hook to
   utils.getProcessValue("/usr/bin/gzip", args=[old_name]) would seem simpler
   and possibly even more efficient.
5. Perhaps the correct thing to do is make Logfile subclassable enough so
   a compressing Logfile could be written as a subclass. 




More information about the Twisted-Python mailing list