Added logging to `with_retry`.