Skip to content

How to use rich progress bar with RichHandler and python's logging API? #969

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

You must be logged in to vote

So, you're basically saying that we would need to rebuild this logic, but without relying on the logging API? Do you have any further pointers on that?

Pretty much.

If you are using a queue, your workers would call queue.put() when they have progress to update. Your main process would receive these updates with queue.get() in a loop, and update the Progress bar accordingly.

By the way, for tqdm it seems to be possible to couple it with the logging

You can convert Rich objects to text and log that, which is what tqdm is doing there.

Edit: Now that I'm thinking about it, we probably need a general way to forward all information send to stdout and stderr in the child process to the main…

Replies: 4 comments 3 replies

Comment options

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

Comment options

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

Answer selected by LarsHill
Comment options

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

Comment options

You must be logged in to vote
0 replies
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