Replies: 2 comments
-
Quick answer: It's not possible. However, I just pushed a quick fix for the bug you encountered when calling Keeping with the theme though. Just for future reference, what would feel like a clean, intuitive API that would allow for clearing every log line if needed? Would having to call |
Beta Was this translation helpful? Give feedback.
-
Thank you for fixing it! About the API, good question. Something like A What I was thinking may look more or less like this: logger.loading("0% bla bla bla").clearable();
sleep(Duration::from_millis(1000));
// logger.done(); // bug fixed! :)
logger.update("50% Some text over here");
sleep(Duration::from_millis(1000));
logger.done("Finished!"); If you are looking for more ideas, maybe including a loading bar similar to Python's pip or apt's would be nice, where you can set the progress along your code: logger.loading_bar("Creating temp folders")
// do stuff
logger.set_progress("Creating files", 10); // message, %
// do more stuff
logger.set_progress("Analyzing for malware", 50);
[...]
logger.done("Finished! 1305 viruses found"); Hope you find it useful. I love how the project looks and best wishes ;b |
Beta Was this translation helpful? Give feedback.
-
I'm having a read through the documentation and I found a super cool method which displays a loading animation. I was wondering if it was possible to update such message on the fly.
I will explain myself: let us say that we have a super heavy loading method which wants to output the percentage of work done in different steps and, instead of printing new lines, it wants to update the previous line that was outputted with new information/percentage.
The way I figured out is to stop and reload the animation:
Tho it's not the cleanest, is not the terriblest.
So, coming back to the question: is curretly possible to update a line (be it a loading or not) with library methods?
Beta Was this translation helpful? Give feedback.
All reactions