Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Fix NoStacktraceFormatter #28

Merged
merged 1 commit into from
Feb 8, 2021
Merged

Conversation

pdewacht
Copy link
Contributor

This deals with a surprising gotcha in Python's logging system: the
result of formatException() is cached. If you want to ensure that a
custom formatException method is called, you need to explicitly clear
the exc_text attribute in format().

This is documented behavior, see https://bugs.python.org/issue29056
for background info.

In our setup, we had an earlier handler with a default formatter, so
NoStacktraceFormatter's method was entirely ignored.

This deals with a surprising gotcha in Python's logging system: the
result of formatException() is cached. If you want to ensure that a
custom formatException method is called, you need to explicitly clear
the exc_text attribute in format().

This is documented behavior, see https://bugs.python.org/issue29056
for background info.

In our setup, we had an earlier handler with a default formatter, so
NoStacktraceFormatter's method was entirely ignored.
@mathiasose mathiasose merged commit fea8e1b into mathiasose:master Feb 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants