From 167f10c9f9e04956005db142b3a43f23ef331e91 Mon Sep 17 00:00:00 2001 From: lanvent Date: Sun, 26 Mar 2023 15:27:15 +0800 Subject: [PATCH] plugins : provide help url when plugin init failed --- plugins/banwords/banwords.py | 2 +- plugins/role/role.py | 4 ++-- plugins/sdwebui/sdwebui.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/banwords/banwords.py b/plugins/banwords/banwords.py index 27414a29..77042c17 100644 --- a/plugins/banwords/banwords.py +++ b/plugins/banwords/banwords.py @@ -38,7 +38,7 @@ class Banwords(Plugin): self.handlers[Event.ON_HANDLE_CONTEXT] = self.on_handle_context logger.info("[Banwords] inited") except Exception as e: - logger.warn("Banwords init failed: %s" % e) + logger.warn("Banwords init failed: %s, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/banwords ." % e) diff --git a/plugins/role/role.py b/plugins/role/role.py index ad6f11ab..75530c44 100644 --- a/plugins/role/role.py +++ b/plugins/role/role.py @@ -45,9 +45,9 @@ class Role(Plugin): self.roleplays = {} logger.info("[Role] inited") except FileNotFoundError: - logger.error(f"[Role] init failed, {config_path} not found") + logger.warn(f"[Role] init failed, {config_path} not found, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/role .") except Exception as e: - logger.error("[Role] init failed, exception: %s" % e) + logger.warn("[Role] init failed, exception: %s, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/role ." % e) def get_role(self, name, find_closest=True): name = name.lower() diff --git a/plugins/sdwebui/sdwebui.py b/plugins/sdwebui/sdwebui.py index 04a3bd41..2f8d36b8 100644 --- a/plugins/sdwebui/sdwebui.py +++ b/plugins/sdwebui/sdwebui.py @@ -30,9 +30,9 @@ class SDWebUI(Plugin): self.handlers[Event.ON_HANDLE_CONTEXT] = self.on_handle_context logger.info("[SD] inited") except FileNotFoundError: - logger.error(f"[SD] init failed, {config_path} not found") + logger.warn(f"[SD] init failed, {config_path} not found, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/sdwebui .") except Exception as e: - logger.error("[SD] init failed, exception: %s" % e) + logger.warn("[SD] init failed, exception: %s, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/sdwebui ." % e) def on_handle_context(self, e_context: EventContext):