Skip to content

Commit ab0fce7

Browse files
committed
config loading logging tweaks
1 parent f94a078 commit ab0fce7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

openeo_driver/config/load.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ def __call__(self, force_reload: bool = False) -> OpenEoBackendConfig:
7272

7373
def get(self, force_reload: bool = False) -> OpenEoBackendConfig:
7474
"""Lazy load the config."""
75-
if self._config is None or force_reload:
75+
if self._config is None:
76+
logging.info("lazy load config")
7677
self._config = self._load()
78+
elif force_reload:
79+
logging.info("force reload config")
80+
self._config = self._load()
81+
7782
return self._config
7883

7984
def _default_config(self) -> ContextManager[Path]:
@@ -88,7 +93,7 @@ def _load(self) -> OpenEoBackendConfig:
8893
config_path = os.environ.get(self.OPENEO_BACKEND_CONFIG) or default_config
8994
config = load_from_py_file(path=config_path, variable="config", expected_class=self.expected_class)
9095
if hasattr(config, "id"):
91-
_log.debug(f"Loaded config {config.id=}")
96+
_log.info(f"Loaded config {config.id=}")
9297
return config
9398

9499
def flush(self):

0 commit comments

Comments
 (0)