I think count based logging works really well for batch processing jobs where each item is a fairly constant amount of work. The log shows the time you started and prints another line (with the time) for each 1% of the batch. You can see the progress and guess when it will be done.
The human who is debugging an issue can see when we started, see that some processed successfully, see regular progress through the batch, then see that the 58th percentile batch hasn’t completed and that’ll be where the problem is.
The main benefit over the time based logging is that the code is much simpler, and the log output is simpler too.
There are even libraries like tqdm that do this for you in one line of code.
The human who is debugging an issue can see when we started, see that some processed successfully, see regular progress through the batch, then see that the 58th percentile batch hasn’t completed and that’ll be where the problem is.
The main benefit over the time based logging is that the code is much simpler, and the log output is simpler too.
There are even libraries like tqdm that do this for you in one line of code.