调整日志内容
This commit is contained in:
@@ -62,14 +62,14 @@ class MessageSummaryPlugin(MessagePluginInterface):
|
||||
|
||||
def start(self) -> bool:
|
||||
"""启动插件"""
|
||||
self.LOG.info(f"[{self.name}] 插件已启动")
|
||||
self.status = PluginStatus.RUNNING
|
||||
self.LOG.info(f"{self.name} 插件已启动")
|
||||
return True
|
||||
|
||||
def stop(self) -> bool:
|
||||
"""停止插件"""
|
||||
self.LOG.info(f"[{self.name}] 插件已停止")
|
||||
self.status = PluginStatus.STOPPED
|
||||
self.LOG.info(f"{self.name} 插件已停止")
|
||||
return True
|
||||
|
||||
@plugin_stats_decorator(plugin_name="群聊总结")
|
||||
|
||||
@@ -20,10 +20,10 @@ def plugin_stats_decorator(plugin_name: str) -> Callable:
|
||||
"""
|
||||
# 获取日志记录器
|
||||
logger = logging.getLogger(f"StatsCollector.{plugin_name}")
|
||||
logger.info(f"为插件 '{plugin_name}' 应用统计装饰器")
|
||||
logger.debug(f"为插件 '{plugin_name}' 应用统计装饰器")
|
||||
|
||||
def decorator(func: Callable) -> Callable:
|
||||
logger.info(f"装饰 '{plugin_name}' 的 {func.__name__} 方法")
|
||||
logger.debug(f"装饰 '{plugin_name}' 的 {func.__name__} 方法")
|
||||
|
||||
@functools.wraps(func)
|
||||
def wrapper(self, message: Dict[str, Any]) -> Tuple[bool, str]:
|
||||
|
||||
@@ -69,7 +69,6 @@ class StatsCollectorPlugin(PluginInterface):
|
||||
self.event_manager.register(PluginCallEndEvent, self.handle_plugin_call_end)
|
||||
self.event_manager.register(PluginCallErrorEvent, self.handle_plugin_error)
|
||||
|
||||
self.logger.info("统计收集插件已初始化")
|
||||
return True
|
||||
|
||||
def handle_plugin_call_start(self, event: PluginCallStartEvent) -> None:
|
||||
@@ -158,12 +157,12 @@ class StatsCollectorPlugin(PluginInterface):
|
||||
|
||||
def start(self) -> bool:
|
||||
"""启动插件"""
|
||||
self.LOG.info(f"[{self.name}] 插件已启动")
|
||||
self.status = PluginStatus.RUNNING
|
||||
self.LOG.info(f"{self.name} 插件已启动")
|
||||
return True
|
||||
|
||||
def stop(self) -> bool:
|
||||
"""停止插件"""
|
||||
self.LOG.info(f"[{self.name}] 插件已停止")
|
||||
self.status = PluginStatus.STOPPED
|
||||
self.LOG.info(f"{self.name} 插件已停止")
|
||||
return True
|
||||
|
||||
@@ -112,12 +112,12 @@ class StatsDashboardPlugin(PluginInterface):
|
||||
|
||||
def start(self) -> bool:
|
||||
"""启动插件"""
|
||||
self.LOG.info(f"[{self.name}] 插件已启动")
|
||||
self.status = PluginStatus.RUNNING
|
||||
self.LOG.info(f"{self.name} 插件已启动")
|
||||
return True
|
||||
|
||||
def stop(self) -> bool:
|
||||
"""停止插件"""
|
||||
self.LOG.info(f"[{self.name}] 插件已停止")
|
||||
self.status = PluginStatus.STOPPED
|
||||
self.LOG.info(f"{self.name} 插件已停止")
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user