[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig()
From: |
Lukáš Doktor |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig() |
Date: |
Thu, 28 Sep 2017 11:24:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
Dne 27.9.2017 v 15:03 Eduardo Habkost napsal(a):
> 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" <address@hidden>
> Cc: Fam Zheng <address@hidden>
> Cc: "Philippe Mathieu-Daudé" <address@hidden>
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> tests/vm/basevm.py | 4 ++--
> 1 file 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:
>
Reviewed-by: Lukáš Doktor <address@hidden>
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 1/5] guestperf: Configure logging on all shell frontends, (continued)
[Qemu-devel] [PATCH 5/5] scripts: Remove debug parameter from QEMUMachine, Eduardo Habkost, 2017/09/27