Enable debug mode with env vars

This commit is contained in:
Mark Veidemanis 2022-08-11 20:09:01 +01:00
parent 2a5e6766be
commit 0666c4a153
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 9 additions and 0 deletions

View File

@ -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: