We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExceptionDictTransformer
ExceptionGroup
structlog version 24.4.0
24.4.0
The ExceptionDictTransformer hides the underlying ExceptionGroup#exceptions values.
ExceptionGroup#exceptions
For example, the following ExceptionGroup:
ExceptionGroup("some errors", [ValueError("wrong value"), TypeError("wrong type")])
will be returned as:
[{'exc_type': 'ExceptionGroup', 'exc_value': 'some errors (2 sub-exceptions)', 'syntax_error': None, 'is_cause': False, 'frames': []}]
I would have expected it to recursively iterate through the sub exceptions and add them as a normal top level exception would be transformed.
Maybe I'm missing something here and there is a built in transformer for this?
The text was updated successfully, but these errors were encountered:
Here is a minimal example:
import asyncio import structlog structlog.configure( processors=[ structlog.processors.dict_tracebacks, structlog.processors.JSONRenderer(), ], ) log = structlog.get_logger() async def task(i: int) -> None: raise ValueError(i) await asyncio.sleep(1) async def main() -> None: async with asyncio.TaskGroup() as tg: tg.create_task(task(0)) tg.create_task(task(1)) try: asyncio.run(main()) except Exception as e: log.exception("onoes", exc_info=e)
The Rich traceback of the ConsoleRenderer looks similar though, so the ExceptionDictTransformer behaves "as expected".
I suggest to wait until Textualize/rich#1859 is done and than steal their code as we did before. ;-)
Sorry, something went wrong.
No branches or pull requests
structlog version
24.4.0
The
ExceptionDictTransformer
hides the underlyingExceptionGroup#exceptions
values.For example, the following
ExceptionGroup
:will be returned as:
I would have expected it to recursively iterate through the sub exceptions and add them as a normal top level exception would be transformed.
Maybe I'm missing something here and there is a built in transformer for this?
The text was updated successfully, but these errors were encountered: