feat: add loglevel as command line arguments
- add new argument "--loglevel"
- set loglevel based on the argument if provided
- otherwise use the value from the config file
🤖
This commit is contained in:
parent
db6fd25741
commit
a2e5852159
1 changed files with 3 additions and 0 deletions
3
dc-ops
3
dc-ops
|
@ -21,11 +21,14 @@ with configfile.open("r") as f:
|
|||
# fmt: off
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--ignore-git-status", action="store_true", help="continue even if there are no new commits") # noqa
|
||||
parser.add_argument("--loglevel", help="set loglevel (overrides config file)")
|
||||
args = parser.parse_args()
|
||||
# fmt: on
|
||||
|
||||
# init logging
|
||||
loglevel = cfg.get("loglevel", "INFO").upper()
|
||||
if args.loglevel:
|
||||
loglevel = args.loglevel
|
||||
log.basicConfig(format="%(message)s", level=loglevel)
|
||||
|
||||
# define docker compose parameters
|
||||
|
|
Loading…
Reference in a new issue