Revert "Add logger"

This reverts commit e071906d58d2143ebc7aced055a6ba20b4f31c6e.
This commit is contained in:
CPD 2025-03-12 16:44:35 +01:00
parent 7b24709d3d
commit 561a946f5b

View File

@ -1,8 +1,6 @@
from os import environ, makedirs, path
import yaml
import logging
log = logging.getLogger(__name__)
class ConfigFile:
"""
Class managing a yaml config file.
@ -17,7 +15,6 @@ class ConfigFile:
self.values = init_values
self.filepath = filepath
if path.isfile(self.filepath):
log.debug(f"[{self.filepath}] loading from file")
with open(self.filepath, "r") as file:
self.values |= yaml.safe_load(file)
@ -26,7 +23,6 @@ class ConfigFile:
directory = path.dirname(self.filepath)
if not path.isdir(directory):
makedirs(directory)
log.debug(f"[{self.filepath}] saving to file")
with open(self.filepath, "w") as file:
yaml.dump(self.values, file)
@ -39,12 +35,10 @@ class ConfigFile:
raise KeyError(f"Key '{name}' not found in config file '{self.filepath}'")
def set(self, name: str, value):
log.debug(f"[{self.filepath}] set {name} = {value}")
self.values[name] = value
def get_values(self):
return self.values.copy()
def set_values(self, values):
log.debug(f"[{self.filepath}] set values = {values}")
self.values = values