File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ import logging
2+
13from fastapi import FastAPI
24from servicelib .fastapi .openapi import override_fastapi_openapi_method
35from servicelib .fastapi .profiler_middleware import ProfilerMiddleware
2628from ..services .status_monitor import setup_status_monitor
2729from .settings import ApplicationSettings
2830
31+ LOG_LEVEL_STEP = logging .CRITICAL - logging .ERROR
32+ NOISY_LOGGERS = (
33+ "faststream" ,
34+ "faststream.access" ,
35+ "simcore_service_dynamic_scheduler.services.deferred_manager_common" ,
36+ )
37+
38+ _logger = logging .getLogger (__name__ )
39+
2940
3041def create_app (settings : ApplicationSettings | None = None ) -> FastAPI :
3142 app_settings = settings or ApplicationSettings .create_from_envs ()
3243
44+ # keep mostly quiet noisy loggers
45+ quiet_level : int = max (
46+ min (logging .root .level + LOG_LEVEL_STEP , logging .CRITICAL ), logging .WARNING
47+ )
48+ for name in NOISY_LOGGERS :
49+ logging .getLogger (name ).setLevel (quiet_level )
50+
51+ _logger .debug ("App settings:\n %s" , app_settings .json (indent = 2 ))
52+
3353 app = FastAPI (
3454 title = f"{ PROJECT_NAME } web API" ,
3555 description = SUMMARY ,
You can’t perform that action at this time.
0 commit comments