This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients docs@python, pitrou, vinay.sajip
Date 2013-07-24.13:57:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <260661816.18360175.1374674219341.JavaMail.root@zimbra10-e2.priv.proxad.net>
In-reply-to <1374673547.79.0.153087683232.issue18541@psf.upfronthosting.co.za>
Content
> That does not have a specific example, as it seems simple enough to
> understand as stated.

I think we should acknowledge that people often have difficulties
with the rather simple functionalities of the logging module,
not only the advanced ones.

> The example you mention shows something else - how you would adapt an
> existing class (which might have information to go into the log) so
> that it could be passed (instead of a dict) to the LoggerAdapter
> initialiser.

But how is that necessary for the use case? Your LoggerAdapter-derived
class could take the "existing class" as a constructor parameter (*), then
inject the required info in its overriden process() method.

(*) either by overriding the constructor, or simply by passing the
"existing class" as an entry in the "extra" dict.

If I had trusted your doc blindly, I would have thought it necessary
to go through the "complicated scheme", while the simple scheme is 
actually sufficient to add per-connection info to log messages.
History
Date User Action Args
2013-07-24 13:57:05pitrousetrecipients: + pitrou, vinay.sajip, docs@python
2013-07-24 13:57:05pitroulinkissue18541 messages
2013-07-24 13:57:05pitroucreate