mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-30 22:46:40 +00:00 
			
		
		
		
	🔊 add log for event handle
This commit is contained in:
		| @@ -205,6 +205,7 @@ async def handle_event(bot: "Bot", event: "Event"): | ||||
|     coros = list(map(lambda x: x(bot, event, state), _event_preprocessors)) | ||||
|     if coros: | ||||
|         try: | ||||
|             if show_log: | ||||
|                 logger.debug("Running PreProcessors...") | ||||
|             await asyncio.gather(*coros) | ||||
|         except IgnoredException: | ||||
| @@ -240,10 +241,15 @@ async def handle_event(bot: "Bot", event: "Event"): | ||||
|                 if not break_flag: | ||||
|                     break_flag = True | ||||
|                     logger.debug("Stop event propagation") | ||||
|             elif isinstance(result, Exception): | ||||
|                 logger.opt(colors=True, exception=result).error( | ||||
|                     "<r><bg #f8bbd0>Error when checking Matcher.</bg #f8bbd0></r>" | ||||
|                 ) | ||||
|  | ||||
|     coros = list(map(lambda x: x(bot, event, state), _event_postprocessors)) | ||||
|     if coros: | ||||
|         try: | ||||
|             if show_log: | ||||
|                 logger.debug("Running PostProcessors...") | ||||
|             await asyncio.gather(*coros) | ||||
|         except Exception as e: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user