mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 05:27:30 +08:00
🔊 revert log string
This commit is contained in:
parent
a539fd0062
commit
a88a2f4a4f
@ -158,6 +158,9 @@ class Event(abc.ABC, BaseModel):
|
|||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return f"[{self.get_event_name()}]: {self.get_event_description()}"
|
return f"[{self.get_event_name()}]: {self.get_event_description()}"
|
||||||
|
|
||||||
|
def get_log_string(self) -> str:
|
||||||
|
return f"[{self.get_event_name()}]: {self.get_event_description()}"
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def get_user_id(self) -> str:
|
def get_user_id(self) -> str:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
@ -209,7 +209,7 @@ async def handle_event(bot: "Bot", event: "Event"):
|
|||||||
show_log = True
|
show_log = True
|
||||||
log_msg = f"<m>{bot.type.upper()} {bot.self_id}</m> | "
|
log_msg = f"<m>{bot.type.upper()} {bot.self_id}</m> | "
|
||||||
try:
|
try:
|
||||||
log_msg += str(event)
|
log_msg += event.get_log_string()
|
||||||
except NoLogException:
|
except NoLogException:
|
||||||
show_log = False
|
show_log = False
|
||||||
if show_log:
|
if show_log:
|
||||||
|
Loading…
Reference in New Issue
Block a user