[issue29056] logging.Formatter doesn't respect more than one formatException()

2020-07-21 Thread Matthew Davis
Matthew Davis added the comment: The documentation says "you will have to clear the cached value" What does that mean? How do I clear the cached value? Is there a flush function somewhere? Do I `del` the attribute? Set the attribute to None? The documentation as it stands today does not

[issue29056] logging.Formatter doesn't respect more than one formatException()

2016-12-27 Thread Vinay Sajip
Vinay Sajip added the comment: Perhaps I will try to make it even clearer, but to be fair, the format() documentation is just a few paragraphs above the formatException() documentation. It's all in the section entitled "Formatter Objects", and it's IMO reasonable to expect the whole

[issue29056] logging.Formatter doesn't respect more than one formatException()

2016-12-27 Thread Dan Passaro
Dan Passaro added the comment: If there's no interest in changing the behavior I'd at least suggest that this caching is mentioned in the docs for the formatException() method specifically, with some kind of attention-grabbing note. (Right now this behavior is only explained in the format()

[issue29056] logging.Formatter doesn't respect more than one formatException()

2016-12-27 Thread Vinay Sajip
Changes by Vinay Sajip : -- status: open -> closed ___ Python tracker ___ ___

[issue29056] logging.Formatter doesn't respect more than one formatException()

2016-12-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Can we close this? -- nosy: +rhettinger status: pending -> open ___ Python tracker ___

[issue29056] logging.Formatter doesn't respect more than one formatException()

2016-12-26 Thread Vinay Sajip
Vinay Sajip added the comment: I don't consider this a bug, as the logging documentation for the Handler.format() method states: "Note that the formatted exception information is cached in attribute exc_text. This is useful because the exception information can be pickled and sent across the

[issue29056] logging.Formatter doesn't respect more than one formatException()

2016-12-26 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +vinay.sajip ___ Python tracker ___ ___

[issue29056] logging.Formatter doesn't respect more than one formatException()

2016-12-23 Thread Dan Passaro
Dan Passaro added the comment: Working around this issue can be done by overriding format() in subclasses like so: def format(self, record): record.exc_text = '' try: return super().format(record) finally: record.exc_text = '' --

[issue29056] logging.Formatter doesn't respect more than one formatException()

2016-12-23 Thread Dan Passaro
New submission from Dan Passaro: If two formatters maintain the default implementation of Formatter.format(), but provide custom behavior for Formatter.formatException(), whichever formatException() is called first and returns something truthy is the only formatException() that is used. This is