Skip to content

Commit 1d38fb0

Browse files
committed
fix how logging level is setup
1 parent 786d28a commit 1d38fb0

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/settings.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import datetime
2-
from functools import cached_property
32

43
from pydantic import Field, parse_obj_as, validator
54
from settings_library.application import BaseApplicationSettings
@@ -44,13 +43,9 @@ class _BaseApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
4443
),
4544
)
4645

47-
@cached_property
48-
def LOG_LEVEL(self): # noqa: N802
49-
return self.DYNAMIC_SCHEDULER_LOGLEVEL
50-
51-
@validator("DYNAMIC_SCHEDULER_LOGLEVEL")
46+
@validator("DYNAMIC_SCHEDULER_LOGLEVEL", pre=True)
5247
@classmethod
53-
def valid_log_level(cls, value: str) -> str:
48+
def _validate_log_level(cls, value: str) -> str:
5449
return cls.validate_log_level(value)
5550

5651

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
_the_settings = ApplicationSettings.create_from_envs()
1313

14-
# SEE https://github.com/ITISFoundation/osparc-simcore/issues/3148
15-
logging.basicConfig(level=_the_settings.log_level) # NOSONAR
16-
logging.root.setLevel(_the_settings.log_level)
14+
logging.basicConfig(level=_the_settings.DYNAMIC_SCHEDULER_LOGLEVEL)
15+
logging.root.setLevel(_the_settings.DYNAMIC_SCHEDULER_LOGLEVEL)
1716
config_all_loggers(
1817
log_format_local_dev_enabled=_the_settings.DYNAMIC_SCHEDULER_LOG_FORMAT_LOCAL_DEV_ENABLED
1918
)

0 commit comments

Comments
 (0)