File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
services/dask-sidecar/src/simcore_service_dask_sidecar Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1+ from functools import cached_property
12from pathlib import Path
2- from typing import Annotated , Any
3+ from typing import Annotated , Any , cast
34
45from models_library .basic_types import LogLevel
56from pydantic import AliasChoices , Field , field_validator
7+ from servicelib .logging_utils import LogLevelInt
68from servicelib .logging_utils_filtering import LoggerName , MessageSubstring
79from settings_library .application import BaseApplicationSettings
810from settings_library .rabbit import RabbitSettings
@@ -61,6 +63,10 @@ class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
6163 RabbitSettings | None , Field (json_schema_extra = {"auto_default_from_env" : True })
6264 ]
6365
66+ @cached_property
67+ def log_level (self ) -> LogLevelInt :
68+ return cast (LogLevelInt , self .DASK_SIDECAR_LOGLEVEL )
69+
6470 @field_validator ("DASK_SIDECAR_LOGLEVEL" , mode = "before" )
6571 @classmethod
6672 def _validate_loglevel (cls , value : Any ) -> str :
Original file line number Diff line number Diff line change 1+ from typing import Final
2+
13from servicelib .logging_utils import setup_loggers
24
35from ..settings import ApplicationSettings
46
7+ _NOISY_LOGGERS : Final [tuple [str , ...]] = (
8+ "aio_pika" ,
9+ "aiormq" ,
10+ "werkzeug" ,
11+ )
12+
513
614def setup_app_logging (settings : ApplicationSettings ) -> None :
715 setup_loggers (
816 log_format_local_dev_enabled = settings .DASK_LOG_FORMAT_LOCAL_DEV_ENABLED ,
917 logger_filter_mapping = settings .DASK_LOG_FILTER_MAPPING ,
1018 tracing_settings = None , # no tracing for dask sidecar
1119 log_base_level = settings .log_level ,
12- noisy_loggers = None ,
20+ noisy_loggers = _NOISY_LOGGERS ,
1321 )
You can’t perform that action at this time.
0 commit comments