1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-12-24 18:22:59 +00:00

logging improve

This commit is contained in:
Jörn-Michael Miehe 2020-08-11 12:08:03 +02:00
parent 3522d6bba5
commit 0299e6a86f
3 changed files with 7 additions and 5 deletions

View file

@ -31,6 +31,8 @@ def main():
logging.getLogger().addHandler(log_handler)
set_verbosity(logging.getLogger(), log_handler, args.verbosity)
logging.debug(f"main CLI args: {args}")
kiwi.Runner().run(args.command)

View file

@ -55,20 +55,20 @@ class DockerCommand:
if DockerCommand.__requires_root:
self.__cmd = [config[get_exe_key("sudo")], *self.__cmd]
def __build_cmd(self, args):
def __build_cmd(self, args, **kwargs):
cmd = [*self.__cmd, *args]
logging.debug(f"DockerProgram: {cmd}")
logging.debug(f"DockerProgram cmd{cmd}, kwargs{kwargs}")
return cmd
def run(self, args, **kwargs):
return subprocess.run(
self.__build_cmd(args),
self.__build_cmd(args, **kwargs),
**kwargs
)
def run_less(self, args, **kwargs):
process = subprocess.Popen(
self.__build_cmd(args),
self.__build_cmd(args, **kwargs),
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
**kwargs
)

View file

@ -7,7 +7,7 @@ class ShowCommand(SubCommand):
def __init__(self):
super().__init__(
'show',
description="show effective kiwi.yml"
description="Show effective kiwi.yml"
)
def run(self):