Skip to content
Snippets Groups Projects
Commit 7b5e29f7 authored by Benedikt Wetzel's avatar Benedikt Wetzel Committed by Lorenz Boguhn
Browse files

Make log level configurable

parent 587af04f
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!92Introduce experiment evaluation,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
This commit is part of merge request !83. Comments created here will be created in the context of that merge request.
from fastapi import FastAPI,Request from fastapi import FastAPI,Request
from configuration import Config
import trend_slope_computer as trend_slope_computer import trend_slope_computer as trend_slope_computer
import logging import logging
import os import os
...@@ -10,9 +11,15 @@ app = FastAPI() ...@@ -10,9 +11,15 @@ app = FastAPI()
logging.basicConfig(stream=sys.stdout, logging.basicConfig(stream=sys.stdout,
format="%(asctime)s %(levelname)s %(name)s: %(message)s") format="%(asctime)s %(levelname)s %(name)s: %(message)s")
logger = logging.getLogger("Api") logger = logging.getLogger("API")
if os.getenv('LOG_LEVEL') == 'INFO':
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
elif os.getenv('LOG_LEVEL') == 'WARNING':
logger.setLevel(logging.WARNING)
elif os.getenv('LOG_LEVEL') == 'DEBUG':
logger.setLevel((logging.DEBUG))
def execute(results, threshold, warmup): def execute(results, threshold, warmup):
d = [] d = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment