[Python-Dev] Proposed additional keyword argument in logging calls

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Dec 2 20:45:52 CET 2005


Jim Jewett <jimjjewett <at> gmail.com> writes:

> 
> > I couldn't think of a good reason why it should be possible to overwrite 
these
> > values with values from a user-supplied dictionary, other than to spoof log
> > entries in some way. The intention is to stop a user accidentally 
overwriting
> > one of the above attributes.
> 
> This makes sense, but is it worth the time to check on each logging call?

Perhaps not - it depends on the performance criticality of your application. If 
you don't supply a dictionary, the impact is minimal. If you need better 
performance you can roll your own LogRecord subclass and do everything inline, 
as Skip has mentioned. And if one wants this functionality, and don't check on 
every call, when would be a good time to check?

Regards,


Vinay Sajip



More information about the Python-Dev mailing list