log commands before they start (at debug level)

so you know what you're waiting for
This commit is contained in:
Min RK
2023-03-24 11:58:32 +01:00
parent 6b0b5f2998
commit 5980cb3ef2

View File

@@ -25,10 +25,11 @@ def run_subprocess(cmd, *args, **kwargs):
and failed output directly to the user's screen and failed output directly to the user's screen
""" """
logger = logging.getLogger("tljh") logger = logging.getLogger("tljh")
printable_command = " ".join(cmd)
logger.debug("Running %s", printable_command)
proc = subprocess.run( proc = subprocess.run(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, *args, **kwargs cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, *args, **kwargs
) )
printable_command = " ".join(cmd)
if proc.returncode != 0: if proc.returncode != 0:
# Our process failed! Show output to the user # Our process failed! Show output to the user
logger.error( logger.error(