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