ソースを参照

fix: format log messages for better readability in various services

Manuel 8 ヶ月 前
親
コミット
5435cd1ea6

+ 3 - 1
services/notifications/telegram_service.py

@@ -198,7 +198,9 @@ class TelegramService:
                     try:
                         await self._client.disconnect()
                     except Exception as e:
-                        logger.debug("Error disconnecting previous Telegram client: %s", e)
+                        logger.debug(
+                            "Error disconnecting previous Telegram client: %s", e
+                        )
 
                 self._client = TelegramClient(
                     self.session_name, self.api_id, self.api_hash, proxy=self.proxy

+ 3 - 1
services/quota/quota_scheduler.py

@@ -282,7 +282,9 @@ def register_quota_scheduler_tasks(scheduler):
             try:
                 session.rollback()
             except Exception as e:
-                logger.warning("Error rolling back session after quota check failure: %s", e)
+                logger.warning(
+                    "Error rolling back session after quota check failure: %s", e
+                )
         finally:
             try:
                 session.close()

+ 3 - 1
services/system/system_info.py

@@ -204,7 +204,9 @@ def get_timezone():
             return tz_path.split("zoneinfo/")[-1]
         timedatectl_bin = shutil.which("timedatectl")
         if timedatectl_bin:
-            result = subprocess.run([timedatectl_bin], stdout=subprocess.PIPE, text=True)  # nosec B603
+            result = subprocess.run(
+                [timedatectl_bin], stdout=subprocess.PIPE, text=True
+            )  # nosec B603
             match = re.search(r"Time zone: (\S+)\s+(\S+/\S+)", result.stdout)
             if match:
                 return f"{match.group(1)} {match.group(2)}"

+ 4 - 1
utils/admin.py

@@ -897,7 +897,10 @@ class SquidConfigManager:
                         )
                         return True
                 except Exception as e:
-                    logger.debug("Could not read existing config for comparison, proceeding with write: %s", e)
+                    logger.debug(
+                        "Could not read existing config for comparison, proceeding with write: %s",
+                        e,
+                    )
 
                 # Create single backup before overwriting
                 backup_path = f"{filepath}.bak"