From 657a1a9440c52bc4f6e29ed20c945780bc6eae8f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 11 Oct 2015 02:56:35 +0200 Subject: [Plugin] Improve error tracing --- module/plugins/internal/Plugin.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 387f499fe..ab5dcc447 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -262,7 +262,7 @@ def chunks(iterable, size): class Plugin(object): __name__ = "Plugin" __type__ = "plugin" - __version__ = "0.56" + __version__ = "0.57" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -314,36 +314,46 @@ class Plugin(object): def log_debug(self, *args, **kwargs): self._log("debug", self.__type__, self.__name__, args) if self.pyload.debug and kwargs.get('trace'): + frame = inspect.currentframe() print "Traceback (most recent call last):" - traceback.print_stack() + traceback.print_stack(frame.f_back) + del frame def log_info(self, *args, **kwargs): self._log("info", self.__type__, self.__name__, args) if self.pyload.debug and kwargs.get('trace'): + frame = inspect.currentframe() print "Traceback (most recent call last):" - traceback.print_stack() + traceback.print_stack(frame.f_back) + del frame def log_warning(self, *args, **kwargs): self._log("warning", self.__type__, self.__name__, args) if self.pyload.debug and kwargs.get('trace'): + frame = inspect.currentframe() print "Traceback (most recent call last):" - traceback.print_stack() + traceback.print_stack(frame.f_back) + del frame def log_error(self, *args, **kwargs): self._log("error", self.__type__, self.__name__, args) if self.pyload.debug and kwargs.get('trace', True): + frame = inspect.currentframe() print "Traceback (most recent call last):" - traceback.print_stack() + traceback.print_stack(frame.f_back) + del frame def log_critical(self, *args, **kwargs): self._log("critical", self.__type__, self.__name__, args) if kwargs.get('trace', True): + frame = inspect.currentframe() print "Traceback (most recent call last):" - traceback.print_stack() + traceback.print_stack(frame.f_back) + del frame def set_permissions(self, path): -- cgit v1.2.3