Replies: 1 comment 2 replies
-
The positional args are used to build a string before it gets to Rich. See the logging docs for details. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Based on the documentation I had the expectation that once I add
__rich__
method to a class, printing those objects with rich would work, including for logging. Still, when trying to log an object that implemented rich protocol, I still see it using the plain str method.With example above I get foo as red but myobject is rendered as string instead of using the markup:
What did I miss? -- If I use
__str__
instead it will work but that would also have the undesired effect of always returning the markup representation which is not desired.Beta Was this translation helpful? Give feedback.
All reactions