add more logging

This commit is contained in:
Daniel Fichtinger 2025-07-04 12:44:32 -04:00
parent 941b993287
commit 2b5eef9839
4 changed files with 34 additions and 3 deletions

View file

@ -2,15 +2,21 @@ from dataclasses import dataclass, field
from dacite import from_dict
import yaml
from pathlib import Path
from zona.log import get_logger
logger = get_logger()
def find_config(start: Path | None = None) -> Path | None:
logger.debug("Searching for config file...")
current = (start or Path.cwd()).resolve()
for parent in [current, *current.parents]:
candidate = parent / "config.yml"
if candidate.is_file():
logger.debug(f"Config file {candidate} found.")
return candidate
logger.debug("Couldn't find config file.")
return None