Skip to content

logging and rendering a table #1799

Answered by willmcgugan
auphofBSF asked this question in Q&A
Discussion options

You must be logged in to vote

Rich may handle the rendering in RichHandler, but Python logging is not designed for anything other that simple strings.

Keep in mind that logging can be configured to go anywhere: file, to syslog, to mail, etc. most of which don't support ansi control codes for color, and may break any formatting that Rich does. Which is why it is best to stick to simple string messages.

If you are using logging purely to write to the console, consider using console.log which can display Rich objects without any clever capturing of the output.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@auphofBSF
Comment options

Answer selected by auphofBSF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants