Display a traceback of plugin loading errors when --debug is given (#506)

This commit is contained in:
Sebastian Pipping 2023-04-18 02:06:26 +02:00 committed by GitHub
parent 06d8f491c4
commit 45a633d31f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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