Add python logging to browser and plugin

This commit is contained in:
TrainDoctor
2023-01-29 14:38:45 -08:00
parent 2e53fb217a
commit 994da868af
3 changed files with 10 additions and 1 deletions
+8
View File
@@ -1,5 +1,7 @@
# Full imports
import json
import pprint
from pprint import pformat
# Partial imports
from aiohttp import ClientSession, web
@@ -110,9 +112,15 @@ class PluginBrowser:
logger.info(" at dir " + self.find_plugin_folder(name))
logger.debug("calling frontend unload for %s" % str(name))
await tab.evaluate_js(f"DeckyPluginLoader.unloadPlugin('{name}')")
plugins_snapshot = self.plugins.copy()
snapshot_string = pformat(plugins_snapshot)
logger.debug("current plugins: %s", snapshot_string)
if self.plugins[name]:
logger.debug("Plugin %s was found", name)
self.plugins[name].stop()
logger.debug("Plugin %s was stopped", name)
del self.plugins[name]
logger.debug("Plugin %s was removed from the dictionary", name)
logger.debug("removing files %s" % str(name))
rmtree(self.find_plugin_folder(name))
except FileNotFoundError: