I\'ve struggled for the last couple of months to come up with some clean code to report progress to a user. Everything always seems to boil down to:
ReportProgr
Unfortunately I think the best way to do this does depend on the details -- at the very least what language you are using. For example in python you could use a context manager to allow for writing code like this:
with progress_report("Task 1"):
do_task_1()
This could, e.g., ensure that the "Task 1 is done" is reported even if do_task_1() raises an exception. If you wanted to, you could handle exceptions separately and print something different like "Task 1 failed" or "Task 1 aborted."