Passing contextual information when logging

Antoine Pitrou solipsis at pitrou.net
Tue Jan 8 04:46:34 EST 2008


Hi Vinay,

> I would welcome your views on whether the LoggerAdapter class is
> suitable for adding to the logging package in Python 2.6/3.0. Does it
> do what might reasonably be expected out of the box?

I think it's quite suited to the problem, yes.

One question : why does the exception() method call Logger.error() rather than
Logger.exception() ?

One suggestion : pass in a Logger object rather than a logger name to the
LoggerAdapter constructor. (this also means that users could stack LoggerAdapter
objects if they wanted to)

Thanks

Antoine.





More information about the Python-list mailing list