调整日志级别
This commit is contained in:
15
robot.py
15
robot.py
@@ -47,6 +47,7 @@ class Robot:
|
||||
self.config = config
|
||||
self.LOG = logger
|
||||
|
||||
self.LOG.info(f"="*30)
|
||||
# wechat_ipad 相关属性
|
||||
self.ipad_bot: WechatAPIClient
|
||||
self.ipad_config = None
|
||||
@@ -58,13 +59,13 @@ class Robot:
|
||||
self.alias = None
|
||||
self.phone = None
|
||||
self.message_auto_revoke: MessageAutoRevoke = None
|
||||
self.LOG.info(f"DB+REDIS 连接池开始初始化")
|
||||
self.LOG.debug(f"DB+REDIS 连接池开始初始化")
|
||||
# 使用单例模式获取实例
|
||||
self.db_manager = DBConnectionManager.get_instance(
|
||||
mysql_config=self.config.mariadb,
|
||||
redis_config=self.config.redis
|
||||
)
|
||||
self.LOG.info(f"数据库连接管理器初始化完成")
|
||||
self.LOG.debug(f"数据库连接管理器初始化完成")
|
||||
|
||||
# 为了兼容现有代码,保留原有的连接池
|
||||
self.db_pool = self.db_manager.mysql_pool
|
||||
@@ -78,7 +79,7 @@ class Robot:
|
||||
self.groups = {} # 存储按group_id分组的消息列表,每个group_id最多保留10条消息
|
||||
|
||||
# 初始化插件系统
|
||||
self.LOG.info("开始初始化插件系统...")
|
||||
self.LOG.debug("开始初始化插件系统...")
|
||||
self.plugin_registry = PluginRegistry()
|
||||
self.event_system = EventSystem()
|
||||
self.plugin_modules = {} # 存储已加载的插件模块
|
||||
@@ -97,7 +98,7 @@ class Robot:
|
||||
self.plugins = self.plugin_manager.load_all_plugins()
|
||||
|
||||
# 加载插件
|
||||
self.LOG.info("插件系统初始化完成")
|
||||
self.LOG.debug("插件系统初始化完成")
|
||||
|
||||
GroupBotManager.load_local_cache()
|
||||
# 权限模块加载
|
||||
@@ -117,7 +118,7 @@ class Robot:
|
||||
with open("wechat_ipad/config.toml", "rb") as f:
|
||||
self.ipad_config = tomllib.load(f)
|
||||
|
||||
self.LOG.info("正在初始化wechat_ipad客户端...")
|
||||
self.LOG.debug("正在初始化wechat_ipad客户端...")
|
||||
|
||||
# 检查必要的配置
|
||||
server_url = self.ipad_config.get("server_url", "")
|
||||
@@ -139,7 +140,7 @@ class Robot:
|
||||
)
|
||||
self.ipad_thread.start()
|
||||
|
||||
self.LOG.info("wechat_ipad客户端初始化完成")
|
||||
self.LOG.debug("wechat_ipad客户端初始化完成")
|
||||
return True
|
||||
except Exception as e:
|
||||
self.LOG.error(f"初始化wechat_ipad客户端失败: {e}")
|
||||
@@ -153,7 +154,7 @@ class Robot:
|
||||
async def _wechat_ipad_core(self, server_ip, server_port):
|
||||
"""wechat_ipad核心逻辑,基于bot-core.py"""
|
||||
try:
|
||||
self.LOG.info("启动wechat_ipad bot")
|
||||
self.LOG.debug("启动wechat_ipad bot")
|
||||
# 调用登录接口
|
||||
self.ipad_bot = wechat_ipad.WechatAPIClient(server_ip, server_port)
|
||||
self.message_auto_revoke = MessageAutoRevoke(self.ipad_bot)
|
||||
|
||||
Reference in New Issue
Block a user