Skip to content

Commit

Permalink
iotests: Set up Python logging
Browse files Browse the repository at this point in the history
Set up Python logging module instead of relying on
QEMUMachine._debug to enable debugging messages.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170927130339.21444-3-ehabkost@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Lukáš Doktor <ldoktor@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
  • Loading branch information
ehabkost committed Oct 11, 2017
1 parent bac9608 commit 43851b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/qemu-iotests/iotests.py
Expand Up @@ -28,6 +28,7 @@
import struct
import json
import signal
import logging


# This will not work if arguments contain spaces but is necessary if we
Expand Down Expand Up @@ -467,6 +468,8 @@ def main(supported_fmts=[], supported_oses=['linux']):
else:
output = StringIO.StringIO()

logging.basicConfig(level=(logging.DEBUG if debug else logging.WARN))

class MyTestRunner(unittest.TextTestRunner):
def __init__(self, stream=output, descriptions=True, verbosity=verbosity):
unittest.TextTestRunner.__init__(self, stream, descriptions, verbosity)
Expand Down

0 comments on commit 43851b5

Please sign in to comment.