diff --git a/model/command/command.py b/model/command/command.py index 665c7ffd4..251787cbd 100644 --- a/model/command/command.py +++ b/model/command/command.py @@ -43,7 +43,7 @@ class Command: if hit: return True, res except BaseException as e: - gu.log("{k}插件加载出现问题,原因: {str(e)}\n已安装插件: {cached_plugins.keys}\n如果你没有相关装插件的想法, 请直接忽略此报错, 不影响其他功能的运行。", level=gu.LEVEL_WARNING) + gu.log(f"{k}插件加载出现问题,原因: {str(e)}\n已安装插件: {cached_plugins.keys}\n如果你没有相关装插件的想法, 请直接忽略此报错, 不影响其他功能的运行。", level=gu.LEVEL_WARNING) if self.command_start_with(message, "nick"): return True, self.set_nick(message, platform) diff --git a/model/platform/qq.py b/model/platform/qq.py index 0f21e815f..679e7854d 100644 --- a/model/platform/qq.py +++ b/model/platform/qq.py @@ -12,7 +12,7 @@ class QQ: """ res可以是一个数组,也就是gocq的消息链. """ - gu.log("回复QQ消息: "+str(res), level=gu.LEVEL_INFO, tag="QQ") + gu.log("回复QQ消息: "+str(res), level=gu.LEVEL_INFO, tag="QQ", max_len=30) if isinstance(res, list) and len(res) > 0: await self.client.sendGroupMessage(source.group_id, res) diff --git a/model/platform/qqchan.py b/model/platform/qqchan.py index 1376ace49..0d1a93a5f 100644 --- a/model/platform/qqchan.py +++ b/model/platform/qqchan.py @@ -16,7 +16,7 @@ class QQChan(): self.client.run(appid=appid, token=token) def send_qq_msg(self, message, res, image_mode=False, msg_ref = None): - gu.log("回复QQ频道消息: "+str(res), level=gu.LEVEL_INFO, tag="QQ频道") + gu.log("回复QQ频道消息: "+str(res), level=gu.LEVEL_INFO, tag="QQ频道", max_len=30) if not image_mode: try: diff --git a/util/general_utils.py b/util/general_utils.py index 5810c657c..f4b253ea1 100644 --- a/util/general_utils.py +++ b/util/general_utils.py @@ -41,7 +41,7 @@ def log( tag: str = "System", fg: str = None, bg: str = None, - max_len: int = 20): + max_len: int = 100): """ 日志记录函数 """