req
req copied to clipboard
`retry`: Deprecate `:retry_log_level` in favour of `:retry_log`
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 https://github.com/wojtekmach/req/issues/341#issuecomment-2036354108.