[{"id":1776336,"web_url":"http://patchwork.ozlabs.org/comment/1776336/","msgid":"<20170927132224.GK12223@redhat.com>","list_archive_url":null,"date":"2017-09-27T13:22:24","subject":"Re: [Qemu-devel] [PATCH 5/5] scripts: Remove debug parameter from\n\tQEMUMachine","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:39AM -0300, Eduardo Habkost wrote:\n> All scripts that use the QEMUMachine and QEMUQtestMachine classes\n> (device-crash-test, tests/migration/*, iotests.py, basevm.py)\n> already configure logging.\n> \n> The basicConfig() call inside QEMUMachine.__init__() is being\n> kept just to make sure a script would still work if it didn't\n> configure logging.\n\nI don't find that compelling. IIUC, if we remove this basicConfig\nthey'll see a message that logging is not configured, which is a\nsuitable hint to fix the script to configure logging.\n\n>  \n>          # just in case logging wasn't configured by the main script:\n> -        logging.basicConfig(level=(logging.DEBUG if debug else logging.WARN))\n> +        logging.basicConfig()\n\nSo I'd just remove this line entirely\n\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-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.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 3y2JT23ZNpz9tXs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 23:24:38 +1000 (AEST)","from localhost ([::1]:54831 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 1dxCKK-0001ne-Hn\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 09:24:36 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:57401)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dxCIN-0000qm-N4\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:22:41 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dxCIH-0008Q6-UA\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:22:35 -0400","from mx1.redhat.com ([209.132.183.28]:52380)\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 1dxCIH-0008Pk-Nl\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:22:29 -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 C1D17129867\n\tfor <qemu-devel@nongnu.org>; Wed, 27 Sep 2017 13:22:28 +0000 (UTC)","from redhat.com (unknown [10.42.22.189])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 5DF1F7F65C;\n\tWed, 27 Sep 2017 13:22:27 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com C1D17129867","Date":"Wed, 27 Sep 2017 14:22:24 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Eduardo Habkost <ehabkost@redhat.com>","Message-ID":"<20170927132224.GK12223@redhat.com>","References":"<20170927130339.21444-1-ehabkost@redhat.com>\n\t<20170927130339.21444-6-ehabkost@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170927130339.21444-6-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.38]);\n\tWed, 27 Sep 2017 13:22:28 +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","Subject":"Re: [Qemu-devel] [PATCH 5/5] scripts: Remove debug parameter from\n\tQEMUMachine","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\tqemu-devel@nongnu.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>"}},{"id":1776351,"web_url":"http://patchwork.ozlabs.org/comment/1776351/","msgid":"<20170927133848.GE4115@localhost.localdomain>","list_archive_url":null,"date":"2017-09-27T13:38:48","subject":"Re: [Qemu-devel] [PATCH 5/5] scripts: Remove debug parameter from\n\tQEMUMachine","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 02:22:24PM +0100, Daniel P. Berrange wrote:\n> On Wed, Sep 27, 2017 at 10:03:39AM -0300, Eduardo Habkost wrote:\n> > All scripts that use the QEMUMachine and QEMUQtestMachine classes\n> > (device-crash-test, tests/migration/*, iotests.py, basevm.py)\n> > already configure logging.\n> > \n> > The basicConfig() call inside QEMUMachine.__init__() is being\n> > kept just to make sure a script would still work if it didn't\n> > configure logging.\n> \n> I don't find that compelling. IIUC, if we remove this basicConfig\n> they'll see a message that logging is not configured, which is a\n> suitable hint to fix the script to configure logging.\n\nI don't see the benefit of requiring the caller to configure\nlogging even if they just want the default behavior (WARN\nloglevel, logged to stderr).\n\n> >  \n> >          # just in case logging wasn't configured by the main script:\n> > -        logging.basicConfig(level=(logging.DEBUG if debug else logging.WARN))\n> > +        logging.basicConfig()\n> \n> So I'd just remove this line entirely\n\nI think it does no harm, and can save people from wasting time\ngoogling for \"No handlers could be found for logger\" just to find\nout they need to add a logging.basicConfig() call to their\nscript.","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-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.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 3y2Jp022cPz9ryQ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 23:39:19 +1000 (AEST)","from localhost ([::1]:54866 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 1dxCYW-00065c-JD\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 09:39:16 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:33497)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <ehabkost@redhat.com>) id 1dxCYD-00065I-BQ\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:38:58 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <ehabkost@redhat.com>) id 1dxCY7-0000Tc-L0\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:38:57 -0400","from mx1.redhat.com ([209.132.183.28]:44459)\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 1dxCY7-0000SN-Ed\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 09:38:51 -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 5177612987A\n\tfor <qemu-devel@nongnu.org>; Wed, 27 Sep 2017 13:38:50 +0000 (UTC)","from localhost (ovpn-116-18.gru2.redhat.com [10.97.116.18])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id C894377E52;\n\tWed, 27 Sep 2017 13:38:49 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 5177612987A","Date":"Wed, 27 Sep 2017 10:38:48 -0300","From":"Eduardo Habkost <ehabkost@redhat.com>","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Message-ID":"<20170927133848.GE4115@localhost.localdomain>","References":"<20170927130339.21444-1-ehabkost@redhat.com>\n\t<20170927130339.21444-6-ehabkost@redhat.com>\n\t<20170927132224.GK12223@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170927132224.GK12223@redhat.com>","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.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tWed, 27 Sep 2017 13:38:50 +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","Subject":"Re: [Qemu-devel] [PATCH 5/5] scripts: Remove debug parameter from\n\tQEMUMachine","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>,\n\tqemu-devel@nongnu.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>"}}]