Idiomatic way to log only on retries in Effect pipeline

What's the idiomatic way of logging something only when retrying a failed effect in a pipeline?

At the moment I'm doing this, but this doesn't feel right:
Effect.retry({
  // snip
  while: () => Effect.zipRight(Effect.logError("Failed"), Effect.succeed(true)),
})
Was this page helpful?