[issue6435] logging: cache the traceback text on formatter, instead of record

Vinay Sajip report at bugs.python.org
Fri Jul 10 01:54:22 CEST 2009


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

[snip example of how to achieve same effect as recipe in a simpler way]
>> How will this differ in its effect from your recipe?

> Actually, I did not know about 'Filter' until now. I will give it a
> try sometime.

Wouldn't it improve your recipe further to use more effectively
functionality which is already present in the logging package, instead
of re-inventing the wheel? Filter has been part of the logging package
design from the beginning, and is reasonably well documented.

If my suggestion has the same effect as your recipe, it has the further
benefit of users being able to specify thresholds more flexibly. For
example, in your response to a comment on your recipe, you acknowledge
that perhaps the destination you initially chose for DEBUG message might
need to be reconsidered. This means that it's probably better to provide
mechanism, and leave policy more to the user. With moderately careful
design of the Filter class, more flexibility could be provided with no
real penalty in code size or complexity.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6435>
_______________________________________


More information about the Python-bugs-list mailing list