I have a function decorated with the @retry (from the retrying library), i want to alter the behaviour of the function to log more if this is a retry - is there a built in way to handle this?
i.e. something like this:
from retrying import retry
@retry
def foo():
if retry:
log('retrying')
throw Exception
This library is not updated. You can use tenacity.
doc: https://tenacity.readthedocs.io/en/latest/
You can log before or after