make logging not use f-str, change others to f-str (#22882)

This commit is contained in:
Asuka Minato 2025-07-25 11:32:48 +09:00 committed by GitHub
commit a189d293f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
164 changed files with 557 additions and 563 deletions

View file

@ -21,7 +21,7 @@ def send_email_code_login_mail_task(language: str, to: str, code: str) -> None:
if not mail.is_inited():
return
logging.info(click.style("Start email code login mail to {}".format(to), fg="green"))
logging.info(click.style(f"Start email code login mail to {to}", fg="green"))
start_at = time.perf_counter()
try:
@ -38,9 +38,7 @@ def send_email_code_login_mail_task(language: str, to: str, code: str) -> None:
end_at = time.perf_counter()
logging.info(
click.style(
"Send email code login mail to {} succeeded: latency: {}".format(to, end_at - start_at), fg="green"
)
click.style(f"Send email code login mail to {to} succeeded: latency: {end_at - start_at}", fg="green")
)
except Exception:
logging.exception("Send email code login mail to {} failed".format(to))
logging.exception("Send email code login mail to %s failed", to)