From 9e9c5907eccf2b4280be60d413f305c5ec2a5265 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 31 May 2017 18:30:00 +0200 Subject: [PATCH] Make it easier to find the output of failed commands in the log ...by adding a ^^^^^^^^... line right below the failed command's output. --- pmb/helpers/run.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pmb/helpers/run.py b/pmb/helpers/run.py index 76344158..e9b419a9 100644 --- a/pmb/helpers/run.py +++ b/pmb/helpers/run.py @@ -45,6 +45,10 @@ def core(args, cmd, log_message, log, return_stdout, check=True): except subprocess.CalledProcessError as exc: if check: + if log: + logging.debug("^" * 70) + logging.info("NOTE: The failed command's output is above" + " the ^^^ line in the logfile: " + args.log) raise RuntimeError("Command failed: " + log_message) from exc else: pass