Edinburgh-Genome-Foundry / Proglog

:memo: Logs and progress bars manager for Python
MIT License
105 stars 5 forks source link

Update message in progress bar to display item details #4

Open ravensorb opened 3 weeks ago

ravensorb commented 3 weeks ago

Is there a way to update the text/message in the progress bar while iterating through a list? I'd like to display some metadata related to the item being processed to give context around what is currently happening.

veghp commented 3 weeks ago

Perhaps subclassing ProgressLogger (or ProgressBarLogger) and overwriting callback() (or bars_callback()) as instructed here https://github.com/Edinburgh-Genome-Foundry/Proglog/blob/a30940710bdd52cebc65491984657ad26eca8365/proglog/proglog.py#L49 and here is the answer to this?

Then you can instruct it to print using your item. An example is provided in the readme, under "For more complex customization" ..