From 564089919836456661987166428536c8d42b7e2d Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Tue, 19 Dec 2023 21:51:04 +0100 Subject: [PATCH] feat: add configurable log level --- config.yml.example | 1 + dc-ops | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.yml.example b/config.yml.example index b012f92..4cb1875 100644 --- a/config.yml.example +++ b/config.yml.example @@ -1,3 +1,4 @@ +loglevel: "INFO" # optional stacks: - dir: /path/to/first-repo - dir: /path/to/second-repo diff --git a/dc-ops b/dc-ops index 4c257eb..a130061 100755 --- a/dc-ops +++ b/dc-ops @@ -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"]: