Updated Driver Error Logging & Exceptions

Change-Id: Idd14904b33e82e4cb5d9f84c75978fe686a9b603
Signed-off-by: Maisam Arif <maisarif@amd.com>


[ROCm/amdsmi commit: 3fa96a9e02]
This commit is contained in:
Maisam Arif
2023-09-27 02:37:46 -05:00
committed by Maisam Arif
parent cbdb61c9c5
commit 4fceaa7c5c
5 changed files with 46 additions and 19 deletions
+9 -1
View File
@@ -42,6 +42,12 @@ def _print_error(e, destination):
if __name__ == "__main__":
# Disable traceback before possible init errors in AMDSMICommands and AMDSMIParser
if "DEBUG" in sys.argv:
sys.tracebacklimit = 10
else:
sys.tracebacklimit = -1
amd_smi_commands = AMDSMICommands()
amd_smi_parser = AMDSMIParser(amd_smi_commands.version,
amd_smi_commands.list,
@@ -80,7 +86,9 @@ if __name__ == "__main__":
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging_dict[args.loglevel])
# Disable traceback for non-debug log levels
if args.loglevel != "DEBUG":
if args.loglevel == "DEBUG":
sys.tracebacklimit = 10
else:
sys.tracebacklimit = -1
# Execute subcommands