Skip to content
This repository was archived by the owner on Apr 21, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions wechatbot_client/wechat/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,12 @@ def json_to_action(cls, json_data: Any) -> Optional[ActionRequest]:
try:
action = ActionRequest.parse_obj(json_data)
except ValidationError:
log("ERROR", f"<r>action请求错误: </r>{json_data}")
log("ERROR", f"<r>action请求错误: </r>{escape_tag(format(json_data))}")
return None
logstring = str(action.dict())
if len(logstring) > 200:
logstring = logstring[:200] + "..."
log("SUCCESS", f"<y>收到action请求: </y>{logstring}")
log("SUCCESS", f"<y>收到action请求: </y>{escape_tag(logstring)}")
return action

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions wechatbot_client/wechat/wechat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
StatusUpdateEvent,
)
from wechatbot_client.typing import overrides
from wechatbot_client.utils import logger_wrapper
from wechatbot_client.utils import logger_wrapper, escape_tag

from .adapter import Adapter

Expand Down Expand Up @@ -167,5 +167,5 @@ async def handle_evnt_msg(self, msg: Message) -> None:
if event is None:
log("DEBUG", "未生成合适事件")
return
log("SUCCESS", f"生成事件<g>[{event.__repr_name__()}]</g>:{event.dict()}")
log("SUCCESS", f"生成事件<g>[{event.__repr_name__()}]</g>:{escape_tag(format(event.dict()))}")
await self.handle_event(event)