Skip to content

Commit 1f96cec

Browse files
committed
Improve logging for configuration file reading
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 40dcc3f commit 1f96cec

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/frequenz/sdk/config/_managing_actor.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,16 @@ def _read_config(self) -> abc.Mapping[str, Any] | None:
117117
config: dict[str, Any] = {}
118118

119119
for config_path in self._config_paths:
120+
_logger.info("%s: Reading configuration file %s...", self, config_path)
120121
try:
121122
with config_path.open("rb") as toml_file:
122123
data = tomllib.load(toml_file)
124+
_logger.info(
125+
"%s: Read %s bytes from configuration file %s.",
126+
self,
127+
len(data),
128+
config_path,
129+
)
123130
config = _recursive_update(config, data)
124131
except ValueError as err:
125132
_logger.error("%s: Can't read config file, err: %s", self, err)
@@ -140,6 +147,12 @@ def _read_config(self) -> abc.Mapping[str, Any] | None:
140147
)
141148
return None
142149

150+
_logger.info(
151+
"%s: Read %s/%s configuration files successfully.",
152+
self,
153+
len(self._config_paths) - error_count,
154+
len(self._config_paths),
155+
)
143156
return config
144157

145158
async def send_config(self) -> None:

0 commit comments

Comments
 (0)