From 4b981fd93c02769b036fb3f9458564bb0d7c4b7c Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Thu, 17 Oct 2024 15:14:23 +0800 Subject: [PATCH] fix: Error subpub_msg log --- apps/common/utils/connection.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/common/utils/connection.py b/apps/common/utils/connection.py index 5ec4f95b2..73d845ad8 100644 --- a/apps/common/utils/connection.py +++ b/apps/common/utils/connection.py @@ -47,7 +47,7 @@ class Subscription: self.ch = pb.ch self.sub = sub self.unsubscribed = False - logger.info("Subscribed to channel: ", sub) + logger.info(f"Subscribed to channel: {sub}") def _handle_msg(self, _next, error, complete): """ @@ -106,11 +106,11 @@ class Subscription: def unsubscribe(self): self.unsubscribed = True - logger.info("Unsubscribed from channel: ", self.sub) + logger.info(f"Unsubscribed from channel: {self.sub}") try: self.sub.close() except Exception as e: - logger.warning('Unsubscribe msg error: {}'.format(e)) + logger.warning(f'Unsubscribe msg error: {e}') def retry(self, _next, error, complete): logger.info('Retry subscribe channel: {}'.format(self.ch))