Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
python: Use format string for logging str(obj).
Anders Kaseorgb45484573e49
diff --git a/zerver/lib/fix_unreads.py b/zerver/lib/fix_unreads.pyindex 83576fe48bc..24b283ea669 100644--- a/zerver/lib/fix_unreads.py+++ b/zerver/lib/fix_unreads.py@@ -94,7 +94,7 @@ def fix_unsubscribed(cursor: CursorWrapper, user_profile: UserProfile) -> None:rows = cursor.fetchall()for row in rows:recipient_ids.append(row[0])- logger.info(str(recipient_ids))+ logger.info("%s", recipient_ids)get_timing("get recipients",diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.pyindex ab4209e3cc9..ed067594d50 100644--- a/zerver/lib/send_email.py+++ b/zerver/lib/send_email.py@@ -289,9 +289,7 @@ def send_email()raise EmailNotDeliveredExceptionexcept smtplib.SMTPException as e:- logger.exception(- "Error sending %s email to %s: %s", template, mail.to, str(e), stack_info=True- )+ logger.exception("Error sending %s email to %s: %s", template, mail.to, e, stack_info=True)raise EmailNotDeliveredExceptiondiff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.pyindex 5131de2792a..9b0caa72e51 100644--- a/zerver/worker/queue_processors.py+++ b/zerver/worker/queue_processors.py@@ -958,7 +958,7 @@ class EmbeddedBotWorker(QueueProcessingWorker):bot_handler=self.get_bot_api_client(user_profile),)except EmbeddedBotQuitException as e:- logging.warning(str(e))+ logging.warning("%s", e)@assign_queue("deferred_work")diff --git a/zproject/backends.py b/zproject/backends.pyindex 6e9827b53cc..f473a7a7c54 100644--- a/zproject/backends.py+++ b/zproject/backends.py@@ -1822,12 +1822,12 @@ class SocialAuthMixin(ZulipAuthMixin, ExternalAuthMethod, BaseAuth):# the flow or the IdP is unreliable and returns a bad http response),# don't throw a 500, just send them back to the# login page and record the event at the info log level.- self.logger.info("%s: %s", type(e).__name__, str(e))+ self.logger.info("%s: %s", type(e).__name__, e)return Noneexcept SocialAuthBaseException as e:# Other python-social-auth exceptions are likely# interesting enough that we should log a warning.- self.logger.warning(str(e))+ self.logger.warning("%s", e)return Nonedef should_auto_signup(self) -> bool: