From f526ad45bc0b92c86ff9242470e94bdf23a3080b Mon Sep 17 00:00:00 2001 From: liuwei Date: Thu, 25 Dec 2025 16:30:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=BC=98=E5=8C=96,=E5=87=8F?= =?UTF-8?q?=E5=B0=91ERROR=E7=9A=84=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/base.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/db/base.py b/db/base.py index cd4076e..66d08b2 100644 --- a/db/base.py +++ b/db/base.py @@ -23,7 +23,9 @@ class BaseDBOperator: return cursor.fetchone() return cursor.fetchall() except Exception as e: - self.LOG.error(f"执行查询SQL出错: {e}, SQL: {sql}, 参数: {params}") + self.LOG.error( + f"执行更新SQL出错: {e}, SQL: {sql}, 参数: {str(params)[:200] + '...' if len(str(params)) > 200 else params}" + ) return None finally: conn.close() @@ -37,7 +39,9 @@ class BaseDBOperator: conn.commit() return True except Exception as e: - self.LOG.error(f"执行更新SQL出错: {e}, SQL: {sql}, 参数: {params}") + self.LOG.error( + f"执行更新SQL出错: {e}, SQL: {sql}, 参数: {str(params)[:200] + '...' if len(str(params)) > 200 else params}" + ) conn.rollback() return False finally: