add a exit keyword to console_error function; allows multiple error

lines prior to code exit

Signed-off-by: Karl W Schulz <karl.schulz@amd.com>
This commit is contained in:
Karl W Schulz
2024-03-07 14:52:28 -06:00
کامیت شده توسط Karl W. Schulz
والد 377c642ac2
کامیت 2b24375e8d
+4 -3
مشاهده پرونده
@@ -48,12 +48,13 @@ def demarcate(function):
return wrap_function
def console_error(*argv):
def console_error(*argv,exit=True):
if len(argv) > 1:
logging.error("ERROR: " + f"[{argv[0]}] {argv[1]}")
else:
logging.error("ERROR: " + f"{argv[0]}")
sys.exit(1)
if exit:
sys.exit(1)
def console_log(*argv,indent_level=0):
@@ -258,7 +259,7 @@ def run_prof(fname, profiler_options, workload_dir, mspec, loglevel):
if not success:
if loglevel > logging.INFO:
for line in output.splitlines():
console_error(output)
console_error(output,exit=False)
console_error("Profiling execution failed.")
if new_env: