全面更换orjson

This commit is contained in:
雅诺狐
2025-08-26 14:20:26 +08:00
parent bfabf896b5
commit 4a44ba9866
45 changed files with 991 additions and 1279 deletions

View File

@@ -1,7 +1,7 @@
# 使用基于时间戳的文件处理器,简单的轮转份数限制
import logging
import json
import orjson
import threading
import time
import structlog
@@ -696,7 +696,7 @@ class ModuleColoredConsoleRenderer:
elif isinstance(event, dict):
# 如果是字典,格式化为可读字符串
try:
event_content = json.dumps(event, ensure_ascii=False, indent=None)
event_content = orjson.dumps(event).decode("utf-8")
except (TypeError, ValueError):
event_content = str(event)
else:
@@ -716,7 +716,7 @@ class ModuleColoredConsoleRenderer:
# 确保值也转换为字符串
if isinstance(value, (dict, list)):
try:
value_str = json.dumps(value, ensure_ascii=False, indent=None)
value_str = orjson.dumps(value).decode("utf-8")
except (TypeError, ValueError):
value_str = str(value)
else: