From ecd17c7721dd89a202cb44fb1cf71711ce3749fb Mon Sep 17 00:00:00 2001 From: qsc20001102 Date: Thu, 4 Dec 2025 09:35:40 +0800 Subject: [PATCH] 11 --- core/async_mysql.py | 2 ++ core/request.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/async_mysql.py b/core/async_mysql.py index 75a89f1..022ee56 100644 --- a/core/async_mysql.py +++ b/core/async_mysql.py @@ -1,5 +1,6 @@ import aiomysql +from astrbot.api import logger class AsyncMySQL: def __init__(self, db_config: dict): @@ -71,6 +72,7 @@ class AsyncMySQL: keys = ", ".join(f"`{k}`" for k in data.keys()) placeholders = ", ".join(["%s"] * len(data)) sql = f"INSERT INTO `{table}` ({keys}) VALUES ({placeholders})" + logger.info(f"Executing SQL: {sql}") return await self.execute(sql, tuple(data.values())) async def update_record(self, table: str, data: dict, where: dict): diff --git a/core/request.py b/core/request.py index 7b43000..8526a06 100644 --- a/core/request.py +++ b/core/request.py @@ -2,8 +2,8 @@ import json import aiohttp from typing import Optional, Dict, Any, Union, List - from aiohttp import ClientTimeout, ClientSession + from astrbot.api import logger class APIClient: