[Twisted-Python] Python 2.3 logging package and Twisted...

Itamar Shtull-Trauring itamar at itamarst.org
Thu Jun 19 20:40:49 MDT 2003


On Fri, 20 Jun 2003 12:18:07 +1000
Stuart Hungerford <stuart.hungerford at anu.edu.au> wrote:

> In applications using Twisted.web is writing logs with this
> new module the kind of operation that would need to be done in
> a deferred?

Uh. It can't be *blocking*. Writing to a log file is fine. Writing to a
socket would block, so don't do that. Using a Deferred doesn't magically
make it not block.

> I understand there's also twisted.python.log, but the issue
> comes up for applications being moved to Twisted that already
> use external logging libraries.

You can use it, sure, or whatever library you want, as long as they
don't block. In fact you can hook up logging to t.p.log too if you want
(log.addObserver with a little glue function.)


-- 
Itamar Shtull-Trauring    http://itamarst.org/
http://www.zoteca.com -- Python & Twisted consulting




More information about the Twisted-Python mailing list