On 27.02.20 01:06, John Snow wrote: > We can turn logging on/off globally instead of per-function. > > Remove use_log from run_job, and use python logging to turn on > diffable output when we run through a script entry point. > > iotest 245 changes output order due to buffering reasons. > > Signed-off-by: John Snow <js...@redhat.com> > --- > tests/qemu-iotests/030 | 4 +-- > tests/qemu-iotests/245 | 1 + > tests/qemu-iotests/245.out | 24 ++++++++--------- > tests/qemu-iotests/iotests.py | 50 +++++++++++++++++++++-------------- > 4 files changed, 45 insertions(+), 34 deletions(-)
[...] > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py > index b02d7932fa..60c4c7f736 100644 > --- a/tests/qemu-iotests/iotests.py > +++ b/tests/qemu-iotests/iotests.py > @@ -35,6 +35,14 @@ > > assert sys.version_info >= (3, 6) > > +# Use this logger for logging messages directly from the iotests module > +logger = logging.getLogger('qemu.iotests') > +logger.addHandler(logging.NullHandler()) Hm, I never see another handler added to this, so how can these messages actually be printed? Will enabling debug mode somehow make all loggers print everything? > +# Use this logger for messages that ought to be used for diff output. > +test_logger = logging.getLogger('qemu.iotests.diff_io') Also, why does logger get a null handler and this by default does not? I’m asking because test_logger makes it look like you don’t necessarily need a handler for output to be silently discarded. Max > # This will not work if arguments contain spaces but is necessary if we > # want to support the override options that ./check supports. > qemu_img_args = [os.environ.get('QEMU_IMG_PROG', 'qemu-img')]
signature.asc
Description: OpenPGP digital signature