logging module and threading

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Jun 13 14:17:12 EDT 2007


On Jun 13, 1:28 am, "James T. Dennis" <jades... at idiom.com> wrote:
>  This sounds like a job for the Queue class/module to me.
>  Could you create a Queue such that all your worker threads
>  are producers to it and you have one dedicated thread as a
>  consumer that relays log entries from the Queue into your loggers?

Or, use a SocketHandler to serialize the events over a socket, and de-
mux them on the receiving end. The docs have an example:

http://docs.python.org/lib/network-logging.html

Regards,

Vinay Sajip




More information about the Python-list mailing list