From 5508d9a789c4e3bdc3d2c4c4ab57e6730eca9dd3 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Fri, 9 Jun 2023 14:30:38 -0700 Subject: [PATCH] Include filename on exit. --- src/pyutils/bootstrap.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pyutils/bootstrap.py b/src/pyutils/bootstrap.py index 7ef7ef1..6d4e63b 100644 --- a/src/pyutils/bootstrap.py +++ b/src/pyutils/bootstrap.py @@ -307,6 +307,8 @@ def initialize(entry_point): ): entry_filename = entry_point.__globals__["__file__"] entry_descr = entry_filename + if not entry_filename: + entry_filename = 'UNKNOWN' config.parse(entry_filename) if config.config["trace_memory"]: @@ -426,10 +428,11 @@ def initialize(entry_point): ) # If it doesn't return cleanly, call attention to the return value. + base_filename = os.path.basename(entry_filename) if ret is not None and ret != 0: - logger.error("Exit %s", ret) + logger.error("%s: Exit %s", base_filename, ret) else: - logger.debug("Exit %s", ret) + logger.debug("%s: Exit %s", base_filename, ret) sys.exit(ret) return initialize_wrapper -- 2.46.0