Skip to content

Commit

Permalink
basevm: Call logging.basicConfig()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ehabkost committed Oct 11, 2017
1 parent 43851b5 commit fb3b4e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/vm/basevm.py
Expand Up @@ -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:
Expand Down

0 comments on commit fb3b4e6

Please sign in to comment.