From ab273f3dbe45295832bfdf1672dc83087d209aad Mon Sep 17 00:00:00 2001 From: edsion Date: Thu, 14 Oct 2021 11:35:46 +0800 Subject: [PATCH] feat: support new string formatting --- backoff/_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backoff/_common.py b/backoff/_common.py index 2b2e54e..119188f 100644 --- a/backoff/_common.py +++ b/backoff/_common.py @@ -93,7 +93,7 @@ def _config_handlers( # Default backoff handler def _log_backoff(details, logger, log_level): - msg = "Backing off %s(...) for %.1fs (%s)" + msg = "Backing off {}(...) for {:.1f}s ({})" log_args = [details['target'].__name__, details['wait']] exc_typ, exc, _ = sys.exc_info() @@ -107,7 +107,7 @@ def _log_backoff(details, logger, log_level): # Default giveup handler def _log_giveup(details, logger, log_level): - msg = "Giving up %s(...) after %d tries (%s)" + msg = "Giving up {}(...) after {:d} tries ({})" log_args = [details['target'].__name__, details['tries']] exc_typ, exc, _ = sys.exc_info()