make logging not use f-str, change others to f-str (#22882)
This commit is contained in:
@@ -22,7 +22,7 @@ def send_owner_transfer_confirm_task(language: str, to: str, code: str, workspac
|
||||
if not mail.is_inited():
|
||||
return
|
||||
|
||||
logging.info(click.style("Start owner transfer confirm mail to {}".format(to), fg="green"))
|
||||
logging.info(click.style(f"Start owner transfer confirm mail to {to}", fg="green"))
|
||||
start_at = time.perf_counter()
|
||||
|
||||
try:
|
||||
@@ -41,12 +41,12 @@ def send_owner_transfer_confirm_task(language: str, to: str, code: str, workspac
|
||||
end_at = time.perf_counter()
|
||||
logging.info(
|
||||
click.style(
|
||||
"Send owner transfer confirm mail to {} succeeded: latency: {}".format(to, end_at - start_at),
|
||||
f"Send owner transfer confirm mail to {to} succeeded: latency: {end_at - start_at}",
|
||||
fg="green",
|
||||
)
|
||||
)
|
||||
except Exception:
|
||||
logging.exception("owner transfer confirm email mail to {} failed".format(to))
|
||||
logging.exception("owner transfer confirm email mail to %s failed", to)
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
@@ -63,7 +63,7 @@ def send_old_owner_transfer_notify_email_task(language: str, to: str, workspace:
|
||||
if not mail.is_inited():
|
||||
return
|
||||
|
||||
logging.info(click.style("Start old owner transfer notify mail to {}".format(to), fg="green"))
|
||||
logging.info(click.style(f"Start old owner transfer notify mail to {to}", fg="green"))
|
||||
start_at = time.perf_counter()
|
||||
|
||||
try:
|
||||
@@ -82,12 +82,12 @@ def send_old_owner_transfer_notify_email_task(language: str, to: str, workspace:
|
||||
end_at = time.perf_counter()
|
||||
logging.info(
|
||||
click.style(
|
||||
"Send old owner transfer notify mail to {} succeeded: latency: {}".format(to, end_at - start_at),
|
||||
f"Send old owner transfer notify mail to {to} succeeded: latency: {end_at - start_at}",
|
||||
fg="green",
|
||||
)
|
||||
)
|
||||
except Exception:
|
||||
logging.exception("old owner transfer notify email mail to {} failed".format(to))
|
||||
logging.exception("old owner transfer notify email mail to %s failed", to)
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
@@ -103,7 +103,7 @@ def send_new_owner_transfer_notify_email_task(language: str, to: str, workspace:
|
||||
if not mail.is_inited():
|
||||
return
|
||||
|
||||
logging.info(click.style("Start new owner transfer notify mail to {}".format(to), fg="green"))
|
||||
logging.info(click.style(f"Start new owner transfer notify mail to {to}", fg="green"))
|
||||
start_at = time.perf_counter()
|
||||
|
||||
try:
|
||||
@@ -121,9 +121,9 @@ def send_new_owner_transfer_notify_email_task(language: str, to: str, workspace:
|
||||
end_at = time.perf_counter()
|
||||
logging.info(
|
||||
click.style(
|
||||
"Send new owner transfer notify mail to {} succeeded: latency: {}".format(to, end_at - start_at),
|
||||
f"Send new owner transfer notify mail to {to} succeeded: latency: {end_at - start_at}",
|
||||
fg="green",
|
||||
)
|
||||
)
|
||||
except Exception:
|
||||
logging.exception("new owner transfer notify email mail to {} failed".format(to))
|
||||
logging.exception("new owner transfer notify email mail to %s failed", to)
|
||||
|
||||
Reference in New Issue
Block a user