Adds support for a `logger` parameter

Will send a warn message to the given logger for more insight into what
is being retried and why.