summaryrefslogtreecommitdiff
path: root/plugin_loader/main.py
diff options
context:
space:
mode:
authortza <marios8543@gmail.com>2022-04-06 12:53:19 +0300
committertza <marios8543@gmail.com>2022-04-06 12:53:19 +0300
commita6943dd7a25d0d787308897f6f55d44e89c216cf (patch)
tree5cc3023cd71fa97a79fe5f7f8a73cadfef05253b /plugin_loader/main.py
parent85e5554c05a60b701fd69fabe47e74fb83ebfd68 (diff)
downloaddecky-loader-a6943dd7a25d0d787308897f6f55d44e89c216cf.tar.gz
decky-loader-a6943dd7a25d0d787308897f6f55d44e89c216cf.zip
enabled logging, fixed loader refresh bug, removed template
Diffstat (limited to 'plugin_loader/main.py')
-rw-r--r--plugin_loader/main.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/plugin_loader/main.py b/plugin_loader/main.py
index da371310..7e13a2d8 100644
--- a/plugin_loader/main.py
+++ b/plugin_loader/main.py
@@ -1,7 +1,18 @@
+from logging import basicConfig, INFO, DEBUG
+from os import getenv
+CONFIG = {
+ "plugin_path": getenv("PLUGIN_PATH", "/home/deck/homebrew/plugins"),
+ "server_host": getenv("SERVER_HOST", "127.0.0.1"),
+ "server_port": int(getenv("SERVER_PORT", "1337")),
+ "live_reload": getenv("LIVE_RELOAD", "1") == "1",
+ "log_level": {"CRITICAL": 50, "ERROR": 40, "WARNING":30, "INFO": 20, "DEBUG": 10}[getenv("LOG_LEVEL", "INFO")]
+}
+basicConfig(level=CONFIG["log_level"], format="[%(module)s][%(levelname)s]: %(message)s")
+
from aiohttp.web import Application, run_app, static
from aiohttp_jinja2 import setup as jinja_setup
from jinja2 import FileSystemLoader
-from os import getenv, path
+from os import path
from asyncio import get_event_loop
from json import loads, dumps
@@ -9,13 +20,6 @@ from loader import Loader
from injector import inject_to_tab, get_tabs
from utilities import util_methods
-CONFIG = {
- "plugin_path": getenv("PLUGIN_PATH", "/home/deck/homebrew/plugins"),
- "server_host": getenv("SERVER_HOST", "127.0.0.1"),
- "server_port": int(getenv("SERVER_PORT", "1337")),
- "live_reload": getenv("LIVE_RELOAD", "1") == "1"
-}
-
class PluginManager:
def __init__(self) -> None:
self.loop = get_event_loop()