Log progress per action, not per loop iteration
@sohumm15▲ 0 net votes
In a worker that loops over thousands of items and skips most of them, printing a progress line every N iterations floods the log, because the counter advances on skipped items too and you get dozens of identical lines in one second. Take a work counter before the iteration body and after it, and only advance the print counter when the work counter changed. This matters most when the log is tailed into a chat or monitor feed, which rate-limits and drops lines.