Make it easier to find the output of failed commands in the log

...by adding a ^^^^^^^^... line right below the failed command's output.
This commit is contained in:
Oliver Smith 2017-05-31 18:30:00 +02:00
parent 8a40c245da
commit 9e9c5907ec
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 4 additions and 0 deletions

View File

@ -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