tenacity icon indicating copy to clipboard operation
tenacity copied to clipboard

logging helpers could include call arguments

Open dz0 opened this issue 4 years ago • 1 comments

I'm using before_sleep with async - and I can see same function is being retried,

but I'd like to see what arguments are for each retried function (as same fun with different args are executed concurrently)

maybe in call could bind args, kwargs to retry object (self) -- and then they will be passed to log_it?

dz0 avatar Oct 21 '20 12:10 dz0

+1. This would be useful if I need the logging message to display something like "attempts 1 out of 5 tried...", in which the number 5 is the value I pass to retry(stop=stop_after_attempt(5)).

suimong avatar Nov 09 '20 13:11 suimong