Display a traceback of plugin loading errors when --debug is given

This commit is contained in:
Sebastian Pipping 2023-01-24 19:02:04 +01:00
parent 201e6d2982
commit 6259444a91
1 changed files with 4 additions and 0 deletions

View File

@ -85,6 +85,10 @@ class PluginManager:
try:
self.__load_plugin(plugin)
except BaseException as e:
traceback_wanted = logging.getLogger().getEffectiveLevel() == logging.DEBUG
if traceback_wanted:
import traceback
traceback.print_exc()
logging.error('Error in loading the plugin %s: %s', plugin['id'], e)
continue
# Initialize the plugins