diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-11 02:56:35 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-11 02:56:35 +0200 |
commit | 657a1a9440c52bc4f6e29ed20c945780bc6eae8f (patch) | |
tree | 69b090bcc9525dd9bcee6c44f86b4f74ed87424a | |
parent | Fix https://github.com/pyload/pyload/issues/1960 (diff) | |
download | pyload-657a1a9440c52bc4f6e29ed20c945780bc6eae8f.tar.xz |
[Plugin] Improve error tracing
-rw-r--r-- | module/plugins/internal/Plugin.py | 22 |
1 files 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): |