Newsgroups: comp.lang.python
From: Vinay Sajip <vinay_sa...@yahoo.co.uk>
Date: Tue, 8 Jan 2008 01:08:08 -0800 (PST)
Local: Tues 8 Jan 2008 09:08
Subject: Passing contextual information when logging
Some users of the logging package have raised an issue regarding the
difficulty of passing additional contextual information when logging. For example, the developer of a networked application may want to log, in addition to specifics related to to the network service being provided, information about the IP address of the remote machine and the username of the person logged into and using the service. Python 2.4 introduced an 'extra' keyword argument which was intended While this works, it is a little unwieldy to use in practice, because One solution is to create a generic wrapper around loggers to which a I would welcome your views on whether the LoggerAdapter class is Best regards, Vinay Sajip You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: comp.lang.python
From: Antoine Pitrou <solip...@pitrou.net>
Date: Tue, 8 Jan 2008 09:46:34 +0000 (UTC)
Local: Tues 8 Jan 2008 09:46
Subject: Re: Passing contextual information when logging
Hi Vinay, > I would welcome your views on whether the LoggerAdapter class is I think it's quite suited to the problem, yes. > 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? One question : why does the exception() method call Logger.error() rather than One suggestion : pass in a Logger object rather than a logger name to the Thanks Antoine. You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: comp.lang.python
From: Vinay Sajip <vinay_sa...@yahoo.co.uk>
Date: Tue, 8 Jan 2008 06:23:58 -0800 (PST)
Local: Tues 8 Jan 2008 14:23
Subject: Re: Passing contextual information when logging
On 8 Jan, 09:46, Antoine Pitrou <solip...@pitrou.net> wrote:
> One question : why does the exception() method call Logger.error() rather than exception() is a convenience method which adds the keyword argument > Logger.exception() ? 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 Done, see http://dpaste.com/30253/ > LoggerAdapter constructor. (this also means that users could stack LoggerAdapter > objects if they wanted to) Regards, Vinay You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
| Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy |
| ©2009 Google |