From: Scott Gasch Date: Fri, 9 Jun 2023 21:30:38 +0000 (-0700) Subject: Include filename on exit. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=5508d9a789c4e3bdc3d2c4c4ab57e6730eca9dd3;p=pyutils.git Include filename on exit. --- 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