🎨 change event log

This commit is contained in:
yanyongyu 2020-12-19 00:26:24 +08:00
parent 799144e64d
commit 00305a8436
2 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ class Event(abc.ABC, BaseModel):
def get_event_description(self) -> str:
raise NotImplementedError
def get_log_string(self) -> str:
def __str__(self) -> str:
return f"[{self.get_event_name()}]: {self.get_event_description()}"
@abc.abstractmethod

View File

@ -209,7 +209,7 @@ async def handle_event(bot: "Bot", event: "Event"):
show_log = True
log_msg = f"<m>{bot.type.upper()} {bot.self_id}</m> | "
try:
log_msg += event.get_log_string()
log_msg += str(event)
except NoLogException:
show_log = False
if show_log: