wojtekmach/req

`retry`: Deprecate `:retry_log_level` in favour of `:retry_log`

Opened this issue · 0 comments

Currently we can set retry_log_level: :debug | :info | ... | false. Besides log level it would be nice to format the log message and I think we can achieve this with deprecating this option in favour of:

retry_log: :debug | :info | ... | :emergency | fun | false

where fun is f(request, response_or_exception) :: term(), that is, one would call say Logger.error(custom_message) themselves for maximum flexibility.

If accepted, we'd do similar for retry though there the contract would most likely be f(request, response, location) as we do some additional normalisation.

That being said, retry is by far the most complicated step at the moment so ideally I'd not make it even more so, if there is another way to solve this problem. There is also the matter of #341 (comment).