mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-05 03:24:53 +08:00
🔇 remove meta event logs #21
This commit is contained in:
parent
a40f1a453c
commit
06f20281a5
@ -54,6 +54,7 @@ async def _run_matcher(Matcher: Type[Matcher], bot: Bot, event: Event,
|
|||||||
|
|
||||||
|
|
||||||
async def handle_event(bot: Bot, event: Event):
|
async def handle_event(bot: Bot, event: Event):
|
||||||
|
show_log = True
|
||||||
log_msg = f"<m>{bot.type.upper()} </m>| {event.self_id} [{event.name}]: "
|
log_msg = f"<m>{bot.type.upper()} </m>| {event.self_id} [{event.name}]: "
|
||||||
if event.type == "message":
|
if event.type == "message":
|
||||||
log_msg += f"Message {event.id} from "
|
log_msg += f"Message {event.id} from "
|
||||||
@ -71,7 +72,9 @@ async def handle_event(bot: Bot, event: Event):
|
|||||||
elif event.type == "request":
|
elif event.type == "request":
|
||||||
log_msg += f"Request {event.raw_event}"
|
log_msg += f"Request {event.raw_event}"
|
||||||
elif event.type == "meta_event":
|
elif event.type == "meta_event":
|
||||||
log_msg += f"MetaEvent {event.detail_type}"
|
# log_msg += f"MetaEvent {event.detail_type}"
|
||||||
|
show_log = False
|
||||||
|
if show_log:
|
||||||
logger.opt(colors=True).info(log_msg)
|
logger.opt(colors=True).info(log_msg)
|
||||||
|
|
||||||
coros = []
|
coros = []
|
||||||
@ -100,6 +103,7 @@ async def handle_event(bot: Bot, event: Event):
|
|||||||
for matcher in matchers[priority]
|
for matcher in matchers[priority]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if show_log:
|
||||||
logger.debug(f"Checking for matchers in priority {priority}...")
|
logger.debug(f"Checking for matchers in priority {priority}...")
|
||||||
results = await asyncio.gather(*pending_tasks, return_exceptions=True)
|
results = await asyncio.gather(*pending_tasks, return_exceptions=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user