add more logging
This commit is contained in:
parent
941b993287
commit
2b5eef9839
4 changed files with 34 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue