From b15c3985fc968a14f242f39315b5e453e5b8683e Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Mon, 23 Jan 2023 14:31:53 +0100 Subject: [PATCH] Better fpga-tool-perf error handling Signed-off-by: Maciej Kurc --- fpgaperf.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fpgaperf.py b/fpgaperf.py index 10eb9c86f..74a020cc4 100755 --- a/fpgaperf.py +++ b/fpgaperf.py @@ -25,6 +25,7 @@ import signal import sys import yaml +import traceback from terminaltables import AsciiTable from toolchains.icestorm import NextpnrIcestorm @@ -271,7 +272,13 @@ def run( err = str(e) if not verbose and len(err) > 1000: err = f"[...]\n{err[-1000:]}" - logger.debug(f"ERROR: {err}") + logger.error(err) + + if verbose: + trace = traceback.format_exc() + for line in trace.split("\n"): + logger.error(line) + err = err.split("\n") else: logger.debug("Printing Stats")