-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
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
Allow to print (log) messages above the progress bar #27
Comments
You can use newlines in the template. There are two values that can be set: prefix and message and both can be set. So you can set the "line above" to the prefix and render it. |
Does this work with multi bars? |
Yes. |
I have 4 worker threads with steady_tick enabled. Every time they finish a task I want to log that. Changing the prefix just multiplies the bars for me. The result looks really strange. Surprisingly the tick_chars further update still get updated. It also doesn't really write above all bars. Just above the one the thread is updating which is not what i want. I don't think this is a clean way to write log messages. |
You can use different styles for different bars. So the first bar can be used to write out messages. |
Ok i guess I could try that. But doesn't that mean all threads must have access to the first bar or send messages to the thread responsible for the first bar? This seems like my code will become a lot less readable. This isn't a clean API. It feels like a really dirty workaround. |
I’m gladly accepting patches but I am not sure how this could be done nicer currently. |
Currently messages with
println!()
are overwritten by the next progress bar tick. It would be awesome to have something likepb.log("hello")
and have hello printed with the next tick above the bars.The text was updated successfully, but these errors were encountered: