From 45a633d31fc16f2c3fc2da23bc598b7a10aabff0 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Tue, 18 Apr 2023 02:06:26 +0200 Subject: [PATCH] Display a traceback of plugin loading errors when --debug is given (#506) --- safeeyes/plugin_manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/safeeyes/plugin_manager.py b/safeeyes/plugin_manager.py index 9e8a53f..6dfaa7a 100644 --- a/safeeyes/plugin_manager.py +++ b/safeeyes/plugin_manager.py @@ -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