mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 09:05:04 +08:00
Log error messages while failed to load plugins
This commit is contained in:
parent
5be0fa7473
commit
2e4c6d8535
@ -133,8 +133,9 @@ def load_plugins(plugin_dir: str, module_prefix: str) -> None:
|
||||
try:
|
||||
_plugins.add(importlib.import_module(mod_name))
|
||||
logger.info(f'Succeeded to import "{mod_name}"')
|
||||
except ImportError:
|
||||
logger.warning(f'Failed to import "{mod_name}"')
|
||||
except Exception as e:
|
||||
logger.error(f'Failed to import "{mod_name}", error: {e}')
|
||||
logger.exception(e)
|
||||
|
||||
|
||||
def load_builtin_plugins() -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user