Commit 6a45fc46 authored by Roman Alifanov's avatar Roman Alifanov

settings: add logging for get/set value

parent c88b202e
......@@ -105,8 +105,11 @@ class DynamicSection(CustomSection):
try:
row = setting.create_row()
if row:
self.logger.debug(f"Adding a row for setting: {setting.name}")
group.add(row)
not_empty = True
else:
self.logger.debug(f"Failed to create a row for setting: {setting.name}")
except Exception as e:
self.logger.error(f"Error creating row for {setting.orig_name}: {str(e)}")
return group if not_empty else None
......
......@@ -84,8 +84,8 @@ class CustomSetting(BaseSetting):
try: value = ast.literal_eval(output)
except Exception as e:
value = output
self.logger.info(f"GET: {output} with error {e}")
self.logger.info(f"GET VALUE {value}")
return value
except subprocess.CalledProcessError as e:
self.logger.error(f"Get command failed: {e.stderr}")
......@@ -96,6 +96,7 @@ class CustomSetting(BaseSetting):
return False
try:
self.logger.info(f"SET VALUE {value}")
cmd = self._format_command(self.set_command, value)
self._execute_command(cmd, capture_output=False)
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment