From 15c635b873105eda2861430d062ea3f6bdfe9d9b Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Fri, 1 Aug 2025 17:02:14 -0400 Subject: Use log_error_for_exception in the Python API to pass tracebacks in the stack trace associated with log messages, instead of creating large mutli-line messages for every exception --- python/functionrecognizer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python/functionrecognizer.py') diff --git a/python/functionrecognizer.py b/python/functionrecognizer.py index 3a81b989..4b0c21f8 100644 --- a/python/functionrecognizer.py +++ b/python/functionrecognizer.py @@ -26,7 +26,7 @@ from . import function from . import filemetadata from . import binaryview from . import lowlevelil -from .log import log_error +from .log import log_error_for_exception from . import mediumlevelil @@ -60,7 +60,7 @@ class FunctionRecognizer: il = lowlevelil.LowLevelILFunction(func.arch, handle=core.BNNewLowLevelILFunctionReference(il)) return self.recognize_low_level_il(view, func, il) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in FunctionRecognizer._recognize_low_level_il") return False def recognize_low_level_il(self, data, func, il): @@ -74,7 +74,7 @@ class FunctionRecognizer: il = mediumlevelil.MediumLevelILFunction(func.arch, handle=core.BNNewMediumLevelILFunctionReference(il)) return self.recognize_medium_level_il(view, func, il) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in FunctionRecognizer._recognize_mediumlevel_il") return False def recognize_medium_level_il(self, data, func, il): -- cgit v1.3.1