Enable debug mode with env vars

This commit is contained in:
Mark Veidemanis 2022-08-11 20:09:01 +01:00
parent b16289cded
commit 6193502f2e
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_address = getenv("THRESHOLD_API_HOST", main.config["API"]["Address"])
api_port = int(getenv("THRESHOLD_API_PORT", main.config["API"]["Port"])) 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__": if __name__ == "__main__":
listener = ServerFactory() listener = ServerFactory()
if listener_ssl is True: if listener_ssl is True: