summaryrefslogtreecommitdiff
path: root/kvmd/aioproc.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2021-10-24 12:02:36 +0300
committerMaxim Devaev <[email protected]>2021-10-24 12:06:40 +0300
commitb6aaf18c4268557753f41ff37cca2c32c48a47e9 (patch)
tree356e9bcd8302f3e19e4f88fd8260116047e98caa /kvmd/aioproc.py
parent434acc5de54b000a85b88decd1776daee914c9c0 (diff)
prefix for log_process()
Diffstat (limited to 'kvmd/aioproc.py')
-rw-r--r--kvmd/aioproc.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/kvmd/aioproc.py b/kvmd/aioproc.py
index 37b44e5c..57ae0f85 100644
--- a/kvmd/aioproc.py
+++ b/kvmd/aioproc.py
@@ -67,13 +67,16 @@ async def log_process(
cmd: List[str],
logger: logging.Logger,
env: Optional[Dict[str, str]]=None,
+ prefix: str="",
) -> asyncio.subprocess.Process: # pylint: disable=no-member
(proc, stdout) = await read_process(cmd, env=env)
if stdout:
log = (logger.info if proc.returncode == 0 else logger.error)
+ if prefix:
+ prefix += " "
for line in stdout.split("\n"):
- log("=> %s", line)
+ log("%s=> %s", prefix, line)
return proc