From 9d9e900ca21dfd872c6fb730fe377d76413a1426 Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Sun, 12 Jan 2025 06:50:13 -0800 Subject: [PATCH] Fixed G004 (logging-f-string): Logging statement uses f-string --- management/daemon.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/management/daemon.py b/management/daemon.py index 046d5851..20c9d05a 100755 --- a/management/daemon.py +++ b/management/daemon.py @@ -161,7 +161,7 @@ def login(): "api_key": auth_service.create_session_key(email, env, type='login'), } - app.logger.info(f"New login session created for {email}") + app.logger.info("New login session created for %s", email) # Return. return json_response(resp) @@ -170,7 +170,7 @@ def login(): def logout(): try: email, _ = auth_service.authenticate(request, env, logout=True) - app.logger.info(f"{email} logged out") + app.logger.info("%s logged out", email) except ValueError: pass finally: @@ -746,7 +746,7 @@ def log_failed_login(request): # We need to add a timestamp to the log message, otherwise /dev/log will eat the "duplicate" # message. - app.logger.warning( f"Mail-in-a-Box Management Daemon: Failed login attempt from ip {ip} - timestamp {time.time()}") + app.logger.warning("Mail-in-a-Box Management Daemon: Failed login attempt from ip %s - timestamp %s", ip, time.time()) # APP