diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2020-03-25 23:42:26 +0100 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2020-03-25 23:42:26 +0100 |
commit | dae4aeb3bb789b7af47c3137476543366c96314b (patch) | |
tree | bc95e12b772d906ee5cf5a5111b56bacdff68424 | |
parent | 645707652b04538be55089086cb46c3ff000283a (diff) | |
download | poezio-dae4aeb3bb789b7af47c3137476543366c96314b.tar.gz poezio-dae4aeb3bb789b7af47c3137476543366c96314b.tar.bz2 poezio-dae4aeb3bb789b7af47c3137476543366c96314b.tar.xz poezio-dae4aeb3bb789b7af47c3137476543366c96314b.zip |
poezio/plugin_manager: add debug when loading plugin
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r-- | poezio/plugin_manager.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py index 58cfb3d3..e603b6fa 100644 --- a/poezio/plugin_manager.py +++ b/poezio/plugin_manager.py @@ -69,7 +69,10 @@ class PluginManager: module = None loader = self.finder.find_module(name, self.load_path) if loader: + log.debug('Found candidate loader for plugin %s: %r', name, loader) module = loader.load_module() + if module is None: + log.debug('Failed to load plugin %s from loader', name) else: try: module = import_module('poezio_plugins.%s' % name) @@ -77,16 +80,19 @@ class PluginManager: pass for entry in pkg_resources.iter_entry_points('poezio_plugins'): if entry.name == name: + log.debug('Found candidate entry for plugin %s: %r', name, entry) try: module = entry.load() - except ImportError: - pass + except ImportError as exn: + log.debug('Failed to import plugin: %s\n%r', name, + exn, exc_info=True) finally: break if not module: self.core.information('Could not find plugin: %s' % name, 'Error') return + log.debug('Plugin %s loaded from "%s"', name, module.__file__) except Exception as e: log.debug("Could not load plugin %s", name, exc_info=True) self.core.information("Could not load plugin %s: %s" % (name, e), |