On 6/10/06, Chaz.
I have an application that I am converting to Twisted. One of the things the application does is have three different logs running. Each of the three does something different.
In normal python logging I figured out how to have the three different loggers. In Twisted I am not quite sure how to do it. Has someone done this before?
You want to write a class or function that will receive a dictionary with 'system', 'message', and possibly 'failure', 'isError', 'debug' and 'printed', and take appropriate action. You may wish to have a look at twisted.python.log.FileLogObserver. Once you have the function or method, you can do a log.addLogObserver(function). You can pass things on to the eventDict as keywords to log.msg, log.error, and log.debug (though the last one is deprecated). If you find that isn't enough for you, it's possible to replace the LogPublisher with something that can gather more data, I currently use one that inspects the stack for which module called it, for example. Moof