[{"id":1776334,"web_url":"http://patchwork.ozlabs.org/comment/1776334/","msgid":"<20170927131957.GI12223@redhat.com>","list_archive_url":null,"date":"2017-09-27T13:19:57","subject":"Re: [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig()","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Wed, Sep 27, 2017 at 10:03:37AM -0300, Eduardo Habkost wrote:\n> Just setting level=DEBUG when debug is enabled is not enough: we\n> need to set up a log handler if we want debug messages generated\n> using logging.getLogger(...).debug() to be printed.\n> \n> This was not a problem before because logging.debug() calls\n> logging.basicConfig() implicitly, but it's safer to not rely on\n> that.\n> \n> Cc: \"Alex Bennée\" <alex.bennee@linaro.org>\n> Cc: Fam Zheng <famz@redhat.com>\n> Cc: \"Philippe Mathieu-Daudé\" <f4bug@amsat.org>\n> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>\n> ---\n>  tests/vm/basevm.py | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n\nReviewed-by: Daniel P. Berrange <berrange@redhat.com>\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2JNL11Mqz9tXw\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 23:20:32 +1000 (AEST)","from localhost ([::1]:54816 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dxCGL-0007kV-69\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 09:20:29 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56759)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dxCG2-0007kO-Ch\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:20:11 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dxCFx-000787-NK\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:20:10 -0400","from mx1.redhat.com ([209.132.183.28]:49078)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dxCFx-00076N-G6\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:20:05 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 833F680C13;\n\tWed, 27 Sep 2017 13:20:04 +0000 (UTC)","from redhat.com (unknown [10.42.22.189])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 5DD967F655;\n\tWed, 27 Sep 2017 13:19:59 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 833F680C13","Date":"Wed, 27 Sep 2017 14:19:57 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Eduardo Habkost <ehabkost@redhat.com>","Message-ID":"<20170927131957.GI12223@redhat.com>","References":"<20170927130339.21444-1-ehabkost@redhat.com>\n\t<20170927130339.21444-4-ehabkost@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170927130339.21444-4-ehabkost@redhat.com>","User-Agent":"Mutt/1.9.0 (2017-09-02)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tWed, 27 Sep 2017 13:20:04 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"=?utf-8?b?THVrw6HFoQ==?= Doktor <ldoktor@redhat.com>,\n\tFam Zheng <famz@redhat.com>, qemu-devel@nongnu.org, Philippe\n\t=?utf-8?q?Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\tCleber Rosa <crosa@redhat.com>, Alex =?utf-8?q?Benn=C3=A9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1776348,"web_url":"http://patchwork.ozlabs.org/comment/1776348/","msgid":"<20170927133544.GC8521@lemon.lan>","list_archive_url":null,"date":"2017-09-27T13:35:44","subject":"Re: [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig()","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Wed, 09/27 10:03, Eduardo Habkost wrote:\n> Just setting level=DEBUG when debug is enabled is not enough: we\n> need to set up a log handler if we want debug messages generated\n> using logging.getLogger(...).debug() to be printed.\n> \n> This was not a problem before because logging.debug() calls\n> logging.basicConfig() implicitly, but it's safer to not rely on\n> that.\n> \n> Cc: \"Alex Bennée\" <alex.bennee@linaro.org>\n> Cc: Fam Zheng <famz@redhat.com>\n> Cc: \"Philippe Mathieu-Daudé\" <f4bug@amsat.org>\n> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>\n> ---\n>  tests/vm/basevm.py | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py\n> index 3c863bc237..686d88decf 100755\n> --- a/tests/vm/basevm.py\n> +++ b/tests/vm/basevm.py\n> @@ -227,8 +227,8 @@ def main(vmcls):\n>          if not argv and not args.build_qemu and not args.build_image:\n>              print \"Nothing to do?\"\n>              return 1\n> -        if args.debug:\n> -            logging.getLogger().setLevel(logging.DEBUG)\n> +        logging.basicConfig(level=(logging.DEBUG if args.debug\n> +                                   else logging.WARN))\n\nI find the \" ? : \" expression in C more readable than this in Python. :)\n\n>          vm = vmcls(debug=args.debug, vcpus=args.jobs)\n>          if args.build_image:\n>              if os.path.exists(args.image) and not args.force:\n> -- \n> 2.13.5\n> \n\nReviewed-by: Fam Zheng <famz@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2JkW2sJLz9tXw\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 23:36:19 +1000 (AEST)","from localhost ([::1]:54858 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dxCVd-0005GP-Hy\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 09:36:17 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60915)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dxCVL-0005GK-GQ\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:36:00 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dxCVH-0007dG-9W\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:35:59 -0400","from mx1.redhat.com ([209.132.183.28]:41520)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dxCVH-0007cw-4J\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:35:55 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 0F5E39FDC3;\n\tWed, 27 Sep 2017 13:35:54 +0000 (UTC)","from localhost (ovpn-12-49.pek2.redhat.com [10.72.12.49])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 8EA0F8BE30;\n\tWed, 27 Sep 2017 13:35:48 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 0F5E39FDC3","Date":"Wed, 27 Sep 2017 21:35:44 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Eduardo Habkost <ehabkost@redhat.com>","Message-ID":"<20170927133544.GC8521@lemon.lan>","References":"<20170927130339.21444-1-ehabkost@redhat.com>\n\t<20170927130339.21444-4-ehabkost@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<20170927130339.21444-4-ehabkost@redhat.com>","User-Agent":"Mutt/1.9.0 (2017-09-02)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tWed, 27 Sep 2017 13:35:54 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"=?utf-8?b?THVrw6HFoQ==?= Doktor <ldoktor@redhat.com>, Philippe\n\t=?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>, Alex\n\t=?iso-8859-1?q?Benn=E9e?= <alex.bennee@linaro.org>,\n\tqemu-devel@nongnu.org, Cleber Rosa <crosa@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1776353,"web_url":"http://patchwork.ozlabs.org/comment/1776353/","msgid":"<20170927134028.GF4115@localhost.localdomain>","list_archive_url":null,"date":"2017-09-27T13:40:28","subject":"Re: [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig()","submitter":{"id":195,"url":"http://patchwork.ozlabs.org/api/people/195/","name":"Eduardo Habkost","email":"ehabkost@redhat.com"},"content":"On Wed, Sep 27, 2017 at 09:35:44PM +0800, Fam Zheng wrote:\n> On Wed, 09/27 10:03, Eduardo Habkost wrote:\n> > Just setting level=DEBUG when debug is enabled is not enough: we\n> > need to set up a log handler if we want debug messages generated\n> > using logging.getLogger(...).debug() to be printed.\n> > \n> > This was not a problem before because logging.debug() calls\n> > logging.basicConfig() implicitly, but it's safer to not rely on\n> > that.\n> > \n> > Cc: \"Alex Bennée\" <alex.bennee@linaro.org>\n> > Cc: Fam Zheng <famz@redhat.com>\n> > Cc: \"Philippe Mathieu-Daudé\" <f4bug@amsat.org>\n> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>\n> > ---\n> >  tests/vm/basevm.py | 4 ++--\n> >  1 file changed, 2 insertions(+), 2 deletions(-)\n> > \n> > diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py\n> > index 3c863bc237..686d88decf 100755\n> > --- a/tests/vm/basevm.py\n> > +++ b/tests/vm/basevm.py\n> > @@ -227,8 +227,8 @@ def main(vmcls):\n> >          if not argv and not args.build_qemu and not args.build_image:\n> >              print \"Nothing to do?\"\n> >              return 1\n> > -        if args.debug:\n> > -            logging.getLogger().setLevel(logging.DEBUG)\n> > +        logging.basicConfig(level=(logging.DEBUG if args.debug\n> > +                                   else logging.WARN))\n> \n> I find the \" ? : \" expression in C more readable than this in Python. :)\n\nI think everybody except Guido does.  :)","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=ehabkost@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2JrV42bXz9sRm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 23:41:30 +1000 (AEST)","from localhost ([::1]:54876 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dxCae-0007Sz-Mu\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 09:41:28 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:34074)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <ehabkost@redhat.com>) id 1dxCaA-0007Pz-6T\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:41:03 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <ehabkost@redhat.com>) id 1dxCa4-0001Oj-E5\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:40:58 -0400","from mx1.redhat.com ([209.132.183.28]:55618)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <ehabkost@redhat.com>) id 1dxCa4-0001OP-7a\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:40:52 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 3C40C7E446;\n\tWed, 27 Sep 2017 13:40:51 +0000 (UTC)","from localhost (ovpn-116-18.gru2.redhat.com [10.97.116.18])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 43CDD89222;\n\tWed, 27 Sep 2017 13:40:29 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 3C40C7E446","Date":"Wed, 27 Sep 2017 10:40:28 -0300","From":"Eduardo Habkost <ehabkost@redhat.com>","To":"Fam Zheng <famz@redhat.com>","Message-ID":"<20170927134028.GF4115@localhost.localdomain>","References":"<20170927130339.21444-1-ehabkost@redhat.com>\n\t<20170927130339.21444-4-ehabkost@redhat.com>\n\t<20170927133544.GC8521@lemon.lan>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<20170927133544.GC8521@lemon.lan>","X-Fnord":"you can see the fnord","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tWed, 27 Sep 2017 13:40:51 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"=?utf-8?b?THVrw6HFoQ==?= Doktor <ldoktor@redhat.com>, Philippe\n\t=?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>, Alex\n\t=?iso-8859-1?q?Benn=E9e?= <alex.bennee@linaro.org>,\n\tqemu-devel@nongnu.org, Cleber Rosa <crosa@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1776902,"web_url":"http://patchwork.ozlabs.org/comment/1776902/","msgid":"<57b8fe55-6534-e27e-041b-5c9a6c16f7c6@redhat.com>","list_archive_url":null,"date":"2017-09-28T09:24:49","subject":"Re: [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig()","submitter":{"id":72013,"url":"http://patchwork.ozlabs.org/api/people/72013/","name":"Lukáš Doktor","email":"ldoktor@redhat.com"},"content":"Dne 27.9.2017 v 15:03 Eduardo Habkost napsal(a):\n> Just setting level=DEBUG when debug is enabled is not enough: we\n> need to set up a log handler if we want debug messages generated\n> using logging.getLogger(...).debug() to be printed.\n> \n> This was not a problem before because logging.debug() calls\n> logging.basicConfig() implicitly, but it's safer to not rely on\n> that.\n> \n> Cc: \"Alex Bennée\" <alex.bennee@linaro.org>\n> Cc: Fam Zheng <famz@redhat.com>\n> Cc: \"Philippe Mathieu-Daudé\" <f4bug@amsat.org>\n> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>\n> ---\n>  tests/vm/basevm.py | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py\n> index 3c863bc237..686d88decf 100755\n> --- a/tests/vm/basevm.py\n> +++ b/tests/vm/basevm.py\n> @@ -227,8 +227,8 @@ def main(vmcls):\n>          if not argv and not args.build_qemu and not args.build_image:\n>              print \"Nothing to do?\"\n>              return 1\n> -        if args.debug:\n> -            logging.getLogger().setLevel(logging.DEBUG)\n> +        logging.basicConfig(level=(logging.DEBUG if args.debug\n> +                                   else logging.WARN))\n>          vm = vmcls(debug=args.debug, vcpus=args.jobs)\n>          if args.build_image:\n>              if os.path.exists(args.image) and not args.force:\n> \n\nReviewed-by: Lukáš Doktor <ldoktor@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=ldoktor@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2q701KfNz9t39\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 19:25:48 +1000 (AEST)","from localhost ([::1]:58118 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dxV4k-0005UY-7x\n\tfor incoming@patchwork.ozlabs.org; Thu, 28 Sep 2017 05:25:46 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60864)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <ldoktor@redhat.com>) id 1dxV43-0005Sy-2M\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 05:25:03 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <ldoktor@redhat.com>) id 1dxV3x-00053I-0D\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 05:25:03 -0400","from mx1.redhat.com ([209.132.183.28]:48596)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <ldoktor@redhat.com>) id 1dxV3w-00052v-NM\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 05:24:56 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id BFA9F107376;\n\tThu, 28 Sep 2017 09:24:55 +0000 (UTC)","from localhost.localdomain (ovpn-204-104.brq.redhat.com\n\t[10.40.204.104])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id DD9735D6A2;\n\tThu, 28 Sep 2017 09:24:50 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com BFA9F107376","To":"Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org","References":"<20170927130339.21444-1-ehabkost@redhat.com>\n\t<20170927130339.21444-4-ehabkost@redhat.com>","From":"=?utf-8?b?THVrw6HFoSBEb2t0b3I=?= <ldoktor@redhat.com>","Message-ID":"<57b8fe55-6534-e27e-041b-5c9a6c16f7c6@redhat.com>","Date":"Thu, 28 Sep 2017 11:24:49 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170927130339.21444-4-ehabkost@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"usrO79NXATIfvr5Ds71QLuhgQuVPb4dhs\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tThu, 28 Sep 2017 09:24:55 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH 3/5] basevm: Call logging.basicConfig()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>, =?utf-8?q?Alex_Benn=C3=A9e?=\n\t<alex.bennee@linaro.org>, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?=\n\t<f4bug@amsat.org>, \tCleber Rosa <crosa@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]