Message28726
Logged In: YES
user_id=1535177
Hi vsajip,
yes, it is by design, but I don't know whether the design is
ideal. But if this behaviour is really intended, it should
be documented clearly, such as:
formatException(exc_info): If you override this method, an
exception in the log record will be formatted by using this
method, but only if this log record wasn't given by the
framework to another formatter (that uses the default format
function) before your formatter got its turn (something you
cannot ensure)...
Now to the question of how to fix the design (provided one
wants to): clearly one cannot change the signature of
formatException without breaking existing code. But one
could change formatter to have an additional field
'labeledCache': a pair of an exc_info tuple and a string
(the cache). The formatException method would then use this
cache only if id() of its argument is the id() of the first
element in the pair, otherwise it would exchange
'labeledCache' by a new pair belonging to the current
exc_info tuple. That's only one posibility to fix this problem. |
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:40:26 | admin | link | issue1501699 messages |
| 2007-08-23 14:40:26 | admin | create | |
|