提交 0a6cd8ce 编写于 作者: L Lukáš Doktor 提交者: Cleber Rosa

avocado.core.output: Update args.show on change

The "args.show" is used later in job. If the value is changed by
other arguments (like --silent) it needs to be updated, otherwise
the job can't react it properly.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 6717e350
......@@ -82,18 +82,18 @@ def reconfigure(args):
Adjust logging handlers accordingly to app args and re-log messages.
"""
# Reconfigure stream loggers
enabled = getattr(args, "show", ["app", "early", "debug"])
enabled = getattr(args, "show", None)
if not isinstance(enabled, list):
enabled = ["app"]
args.show = enabled
if os.environ.get("AVOCADO_LOG_EARLY") and "early" not in enabled:
args.show.append("early")
enabled.append("early")
if os.environ.get("AVOCADO_LOG_DEBUG") and "debug" not in enabled:
args.show.append("debug")
enabled.append("debug")
if getattr(args, "show_job_log", False):
args.show = ["test"]
enabled = ["test"]
del enabled[:]
enabled.append("test")
if getattr(args, "silent", False):
del args.show[:]
del enabled[:]
if "app" in enabled:
app_logger = logging.getLogger("avocado.app")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册