mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 17:15:05 +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:
|
try:
|
||||||
_plugins.add(importlib.import_module(mod_name))
|
_plugins.add(importlib.import_module(mod_name))
|
||||||
logger.info(f'Succeeded to import "{mod_name}"')
|
logger.info(f'Succeeded to import "{mod_name}"')
|
||||||
except ImportError:
|
except Exception as e:
|
||||||
logger.warning(f'Failed to import "{mod_name}"')
|
logger.error(f'Failed to import "{mod_name}", error: {e}')
|
||||||
|
logger.exception(e)
|
||||||
|
|
||||||
|
|
||||||
def load_builtin_plugins() -> None:
|
def load_builtin_plugins() -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user