mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-04 11:04:50 +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,8 +72,10 @@ 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}"
|
||||||
logger.opt(colors=True).info(log_msg)
|
show_log = False
|
||||||
|
if show_log:
|
||||||
|
logger.opt(colors=True).info(log_msg)
|
||||||
|
|
||||||
coros = []
|
coros = []
|
||||||
state = {}
|
state = {}
|
||||||
@ -100,7 +103,8 @@ async def handle_event(bot: Bot, event: Event):
|
|||||||
for matcher in matchers[priority]
|
for matcher in matchers[priority]
|
||||||
]
|
]
|
||||||
|
|
||||||
logger.debug(f"Checking for matchers in priority {priority}...")
|
if show_log:
|
||||||
|
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)
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user