mirror of
https://github.com/yavook/kiwi-scp.git
synced 2024-11-22 12:53:00 +00:00
logging improve
This commit is contained in:
parent
3522d6bba5
commit
0299e6a86f
3 changed files with 7 additions and 5 deletions
|
@ -31,6 +31,8 @@ def main():
|
||||||
logging.getLogger().addHandler(log_handler)
|
logging.getLogger().addHandler(log_handler)
|
||||||
set_verbosity(logging.getLogger(), log_handler, args.verbosity)
|
set_verbosity(logging.getLogger(), log_handler, args.verbosity)
|
||||||
|
|
||||||
|
logging.debug(f"main CLI args: {args}")
|
||||||
|
|
||||||
kiwi.Runner().run(args.command)
|
kiwi.Runner().run(args.command)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,20 +55,20 @@ class DockerCommand:
|
||||||
if DockerCommand.__requires_root:
|
if DockerCommand.__requires_root:
|
||||||
self.__cmd = [config[get_exe_key("sudo")], *self.__cmd]
|
self.__cmd = [config[get_exe_key("sudo")], *self.__cmd]
|
||||||
|
|
||||||
def __build_cmd(self, args):
|
def __build_cmd(self, args, **kwargs):
|
||||||
cmd = [*self.__cmd, *args]
|
cmd = [*self.__cmd, *args]
|
||||||
logging.debug(f"DockerProgram: {cmd}")
|
logging.debug(f"DockerProgram cmd{cmd}, kwargs{kwargs}")
|
||||||
return cmd
|
return cmd
|
||||||
|
|
||||||
def run(self, args, **kwargs):
|
def run(self, args, **kwargs):
|
||||||
return subprocess.run(
|
return subprocess.run(
|
||||||
self.__build_cmd(args),
|
self.__build_cmd(args, **kwargs),
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
def run_less(self, args, **kwargs):
|
def run_less(self, args, **kwargs):
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
self.__build_cmd(args),
|
self.__build_cmd(args, **kwargs),
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
|
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,7 +7,7 @@ class ShowCommand(SubCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
'show',
|
'show',
|
||||||
description="show effective kiwi.yml"
|
description="Show effective kiwi.yml"
|
||||||
)
|
)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
Loading…
Reference in a new issue