qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 5/5] scripts: Remove debug parameter from QEMUMa


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH 5/5] scripts: Remove debug parameter from QEMUMachine
Date: Wed, 27 Sep 2017 10:38:48 -0300
User-agent: Mutt/1.8.3 (2017-05-23)

On Wed, Sep 27, 2017 at 02:22:24PM +0100, Daniel P. Berrange wrote:
> On Wed, Sep 27, 2017 at 10:03:39AM -0300, Eduardo Habkost wrote:
> > All scripts that use the QEMUMachine and QEMUQtestMachine classes
> > (device-crash-test, tests/migration/*, iotests.py, basevm.py)
> > already configure logging.
> > 
> > The basicConfig() call inside QEMUMachine.__init__() is being
> > kept just to make sure a script would still work if it didn't
> > configure logging.
> 
> I don't find that compelling. IIUC, if we remove this basicConfig
> they'll see a message that logging is not configured, which is a
> suitable hint to fix the script to configure logging.

I don't see the benefit of requiring the caller to configure
logging even if they just want the default behavior (WARN
loglevel, logged to stderr).

> >  
> >          # just in case logging wasn't configured by the main script:
> > -        logging.basicConfig(level=(logging.DEBUG if debug else 
> > logging.WARN))
> > +        logging.basicConfig()
> 
> So I'd just remove this line entirely

I think it does no harm, and can save people from wasting time
googling for "No handlers could be found for logger" just to find
out they need to add a logging.basicConfig() call to their
script.

-- 
Eduardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]