From ad4517d4ae5475f934cf0aa99eb6cfec86aa9c04 Mon Sep 17 00:00:00 2001 From: Konstantin Grachev Date: Wed, 27 Jan 2021 00:03:45 +0300 Subject: [PATCH] Log reconnect attempt as warning --- src/Reconnect/ExponentialStrategy.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Reconnect/ExponentialStrategy.php b/src/Reconnect/ExponentialStrategy.php index 13a2680..33626a1 100644 --- a/src/Reconnect/ExponentialStrategy.php +++ b/src/Reconnect/ExponentialStrategy.php @@ -9,7 +9,6 @@ use Psr\Log\LoggerAwareTrait; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; use Throwable; -use function sprintf; final class ExponentialStrategy implements ReconnectStrategy { @@ -53,7 +52,7 @@ final class ExponentialStrategy implements ReconnectStrategy $this->delay = $nextDelay > $this->maxDelay ? $this->maxDelay : $nextDelay; $this->nextTryAfter = $currentTime + $this->delay; - $this->logger->info(sprintf('Reconnect #%s after %ss', ++$this->attempt, $this->delay)); + $this->logger->warning('Reconnect #{attempt} after {delay}s', ['attempt' => ++$this->attempt, 'delay' => $this->delay]); throw $e; }