diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2017-09-27 10:03:37 -0300 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2017-10-11 15:15:17 -0300 |
commit | fb3b4e6d88120da41ae553853b281214f7aac7cf (patch) | |
tree | 31683875ed1c86d4a3c7d93a2c4993d2e4b4558e /tests/vm/basevm.py | |
parent | 43851b5bd48d952561610d0d6d6c314c97eff543 (diff) | |
download | qemu-fb3b4e6d88120da41ae553853b281214f7aac7cf.zip |
basevm: Call logging.basicConfig()
Just setting level=DEBUG when debug is enabled is not enough: we
need to set up a log handler if we want debug messages generated
using logging.getLogger(...).debug() to be printed.
This was not a problem before because logging.debug() calls
logging.basicConfig() implicitly, but it's safer to not rely on
that.
Cc: "Alex Bennée" <alex.bennee@linaro.org>
Cc: Fam Zheng <famz@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170927130339.21444-4-ehabkost@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Lukáš Doktor <ldoktor@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'tests/vm/basevm.py')
-rwxr-xr-x | tests/vm/basevm.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 3c863bc237..686d88decf 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -227,8 +227,8 @@ def main(vmcls): if not argv and not args.build_qemu and not args.build_image: print "Nothing to do?" return 1 - if args.debug: - logging.getLogger().setLevel(logging.DEBUG) + logging.basicConfig(level=(logging.DEBUG if args.debug + else logging.WARN)) vm = vmcls(debug=args.debug, vcpus=args.jobs) if args.build_image: if os.path.exists(args.image) and not args.force: |