Replies: 1 comment
-
The Formatter.format method will insert the traceback in to the message. This would lead to two tracebacks, one standard, and one Rich. This is why Rich bypasses that method when rich_tracebacks are enabled. The unfortunate side-effect is that custom formatters don't get rendered. I'll investigate if there is a way to render custom formatters without inserting a traceback. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am not sure if it is a bug or intended behavior. But I configured a RichHandler with rich traceback toggled on. I also added a custom formatter to include the process name and Id in all log messages.
This works fine for all logging levels with the exception of logging exceptions/errors. Raised errors are logged nicely with rich tracebacks but the process name isn’t included in the logged error message before the traceback. It seems the configured formatter is simply ignored in this case.
This works however, if I replace the RichHandler with a normal StreamHandler. Of course I can manually add the process name to the rich handled error traceback. But if a user of our library doesn’t use rich, he would see the process name twice (once because of the formatter and once because of the manual addition).
Any feedback on this issue is much appreciated :)
Best regards
Lars
Beta Was this translation helpful? Give feedback.
All reactions