feat: add configurable log level

This commit is contained in:
Sebastian Mark 2023-12-19 21:51:04 +01:00
parent ef0620ee41
commit 5640899198
2 changed files with 3 additions and 1 deletions

View file

@ -1,3 +1,4 @@
loglevel: "INFO" # optional
stacks:
- dir: /path/to/first-repo
- dir: /path/to/second-repo

3
dc-ops
View file

@ -18,7 +18,8 @@ with configfile.open("r") as f:
cfg = yaml.safe_load(f.read())
# init logging
log.basicConfig(format="%(message)s", level=log.INFO)
loglevel = cfg.get("loglevel", "INFO").upper()
log.basicConfig(format="%(message)s", level=loglevel)
# iterate all stacks
for stack in cfg["stacks"]: