提交 04490242 编写于 作者: L Lukáš Doktor

avocado.core.plugins: Print traceback on failure

On plugin import failure we get the error message, which in case of
IOError is: "IOError: [Errno 2] No such file or directory". We have to
debug it or add some prints to discover, what happened. Let's add
optional traceback print in the same fashion as the "loader" does.
(the output is ignored unless the user enables "avocado.app.tracebacks")
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 e6771b88
......@@ -15,11 +15,13 @@
"""Builtin plugins."""
import os
import sys
import logging
from importlib import import_module
from .plugin import Plugin
from ..settings import settings
from ...utils import stacktrace
log = logging.getLogger("avocado.app")
......@@ -59,6 +61,8 @@ def load_builtins():
if name not in skip_notify:
log.error('Error loading %s -> %s', name, reason)
ErrorsLoading.append((name, reason))
stacktrace.log_exc_info(sys.exc_info(),
'avocado.app.tracebacks')
continue
for name in plugin_mod.__dict__:
obj = getattr(plugin_mod, name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册