Passing contextual information when logging

Vinay Sajip vinay_sajip at yahoo.co.uk
Tue Jan 8 09:23:58 EST 2008


On 8 Jan, 09:46, Antoine Pitrou <solip... at pitrou.net> wrote:
> One question : why does the exception() method call Logger.error() rather than
> Logger.exception() ?

exception() is a convenience method which adds the keyword argument
exc_info=1 to append traceback information to the log. Both
exception() and error() log at the ERROR level.

> 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)

Done, see http://dpaste.com/30253/

Regards,

Vinay



More information about the Python-list mailing list