You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Latest version of structlog changes behavior of logger.exception a little bit (23.3, 24.1), and now they transform level to "error" in one of the processors, as far as I understand. I would like to see the same behavior in the pytest-structlog, to more accurately test displayable events.
For now pytest-structlog catches level=exception event for logger.exception() calls with stdlib bound logger. I will attach reproducible example in draft PR: #31
The text was updated successfully, but these errors were encountered:
b0g3r
added a commit
to b0g3r/pytest-structlog
that referenced
this issue
Mar 11, 2024
Thanks for the reproducer - I confirm something changed between structlog 23.2 and 23.3 causing this. It looks like adding
if method_name == "exception":
method_name = "error"
into StructuredLogCapture.process would fix this issue, although I'd like to understand better the root cause first.. I had a read through those linked issues and could not quite figure out what went wrong yet.
Latest version of structlog changes behavior of
logger.exception
a little bit (23.3, 24.1), and now they transform level to "error" in one of the processors, as far as I understand. I would like to see the same behavior in the pytest-structlog, to more accurately test displayable events.For now pytest-structlog catches
level=exception
event for logger.exception() calls with stdlib bound logger. I will attach reproducible example in draft PR: #31The text was updated successfully, but these errors were encountered: