Based on the stacktrace I guess your log_every method creates the ZeroDivisionError and I also guess that len(iterable) is zero.
Check what iterable is (I would guess it might be the DataLoader) and try to debug why its length is zero. If that’s expected, skip this logging method in your code or adapt the logging mechanism to avoid dividing by zero.