Unintended traceback omittion #735
Labels
api: logging
Issues related to the googleapis/python-logging API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
After PR #394 was merged, tracebacks are no longer duplicated after structured log messages.
However, the effect of that change is not limited to StructuredLogHandler.
When you try to use StructuredLogHandler in conjunction with some other log handlers as follows, you will encounter an unintended problem.
Specifically, any log handlers will be called later than the StructuredLogHandler will never output traceback because they can not detect record.exc_info and record.exc_text. Both are set to None.
This behaviour is caused by the record object has changed directly in StructuredLogHander.
Code example
Output
As you can see above, the structured log message is output without traceback intendedly.
On the other hand, the log message of SampleHandler is also output without traceback though it's not intended.
Suggestion
The text was updated successfully, but these errors were encountered: