[Twisted-Python] twisted.lumberjack clobbers existing logs

Andrew Bennetts andrew at puzzling.org
Mon Feb 25 18:08:12 EST 2002


On Mon, Feb 25, 2002 at 05:27:33PM +0000, Itamar Shtull-Trauring wrote:
> Andrew Bennetts wrote:
> >I considered that, but when would a log file ever want to do otherwise?
> 
> "a" also screws up seek()s, which I'll need for the remote log viewing
> service. In general, "a" seems like a bad idea since its behavior is
> inconsistent.

Fair enough.

> >I'd be interested to know what a portable way to append to a file is,
> >though.
> 
> 
> # assuming "file" exists
> 
> f = open("file", "r+")
> 
> f.seek(0, 2)
> 
> see the code I checked in for a complete example.

Ah, of course.  Thanks.

-Andrew.





More information about the Twisted-Python mailing list