From 0666c4a153f2351012672585784859974c6f01c8 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 11 Aug 2022 20:09:01 +0100 Subject: [PATCH] Enable debug mode with env vars --- threshold | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/threshold b/threshold index 5706025..c728709 100755 --- a/threshold +++ b/threshold @@ -57,6 +57,15 @@ api_enabled = getenv("THRESHOLD_API_ENABLED", main.config["API"]["Enabled"]) in api_address = getenv("THRESHOLD_API_HOST", main.config["API"]["Address"]) api_port = int(getenv("THRESHOLD_API_PORT", main.config["API"]["Port"])) +# Debugging +debug_enabled = getenv("THRESHOLD_DEBUG", main.config["Debug"]) in trues +trace_enabled = getenv("THRESHOLD_TRACE", main.config["Trace"]) in trues +if debug_enabled: + main.config["Debug"] = True +if trace_enabled: + main.config["Trace"] = True + + if __name__ == "__main__": listener = ServerFactory() if listener_ssl is True: