Skip to content
Snippets Groups Projects
Commit cc7bbb6c authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

Make log level configurable

parent 3040a229
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!96Handle shutdown,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
from fastapi import FastAPI,Request
from configuration import Config
import trend_slope_computer as trend_slope_computer
import logging
import os
......@@ -10,9 +11,15 @@ app = FastAPI()
logging.basicConfig(stream=sys.stdout,
format="%(asctime)s %(levelname)s %(name)s: %(message)s")
logger = logging.getLogger("Api")
logger = logging.getLogger("API")
logger.setLevel(logging.INFO)
if os.getenv('LOG_LEVEL') == '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):
d = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment