#68 add param to set log level

This commit is contained in:
Alok Saldanha
2022-06-20 19:37:40 -04:00
parent 8d8a0a3483
commit 36c0a4d3d7
3 changed files with 4 additions and 2 deletions

View File

@@ -9,7 +9,6 @@
import logging
import os
import socket
cellxgene_location = os.environ.get("CELLXGENE_LOCATION")
cellxgene_data = os.environ.get("CELLXGENE_DATA", "")
@@ -33,6 +32,7 @@ enable_backed_mode = os.environ.get("GATEWAY_ENABLE_BACKED_MODE", "").lower() in
"true",
"1",
]
log_level = logging.getLevelName(os.environ.get("GATEWAY_LOG_LEVEL", "INFO"))
env_vars = {
"CELLXGENE_LOCATION": cellxgene_location,
@@ -53,6 +53,7 @@ optional_env_vars = {
"GATEWAY_TTL": ttl,
"GATEWAY_ENABLE_ANNOTATIONS": enable_annotations,
"GATEWAY_ENABLE_BACKED_MODE": enable_backed_mode,
"GATEWAY_LOG_LEVEL": log_level,
"CELLXGENE_ARGS": cellxgene_args,
"CELLXGENE_DATA": cellxgene_data,
"PROXY_FIX_FOR": proxy_fix_for,

View File

@@ -299,7 +299,7 @@ def launch():
def main():
logging.basicConfig(
level=logging.INFO,
level=env.log_level,
format="%(asctime)s:%(name)s:%(levelname)s:%(message)s",
)
cellxgene_data = os.environ.get("CELLXGENE_DATA", None)