fix: improve logging messages and documentation (#803)

This commit is contained in:
Jens
2026-02-02 17:21:21 +01:00
committed by GitHub
parent e85126ec86
commit 601b405ded
7 changed files with 112 additions and 38 deletions

View File

@@ -79,7 +79,7 @@ def load_dict(filepath:str, content_label:str = "") -> dict[str, Any]:
def load_dict_if_exists(filepath:str, content_label:str = "") -> dict[str, Any] | None:
abs_filepath = files.abspath(filepath)
LOG.info("Loading %s[%s]...", content_label and content_label + " from " or "", abs_filepath)
LOG.debug("Loading %s[%s]...", content_label and content_label + " from " or "", abs_filepath)
__, file_ext = os.path.splitext(filepath)
if file_ext not in {".json", ".yaml", ".yml"}:

View File

@@ -89,7 +89,7 @@ def detect_installation_mode() -> InstallationMode | None:
LOG.debug("Checking for portable config at: %s", portable_config)
if portable_config.exists():
LOG.info("Detected installation mode: %s", "portable")
LOG.debug("Detected installation mode: %s", "portable")
return "portable"
# Check for XDG installation
@@ -97,11 +97,11 @@ def detect_installation_mode() -> InstallationMode | None:
LOG.debug("Checking for XDG config at: %s", xdg_config)
if xdg_config.exists():
LOG.info("Detected installation mode: %s", "xdg")
LOG.debug("Detected installation mode: %s", "xdg")
return "xdg"
# Neither exists - first run
LOG.info("No existing installation found")
LOG.info("No existing configuration (portable or system-wide) found")
return None