From 8af09b8001301e6bb085a23fc029da94e0725c1c Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Thu, 5 Oct 2017 14:20:11 -0300 Subject: guestperf: Configure logging on all shell frontends MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The logging module will eventually replace the 'debug' parameter in QEMUMachine and QEMUMonitorProtocol. Cc: Daniel P. Berrange Signed-off-by: Eduardo Habkost Message-Id: <20171005172013.3098-2-ehabkost@redhat.com> Reviewed-by: Lukáš Doktor Signed-off-by: Eduardo Habkost --- tests/migration/guestperf/shell.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/migration/guestperf/shell.py b/tests/migration/guestperf/shell.py index 7992459a97..b272978f47 100644 --- a/tests/migration/guestperf/shell.py +++ b/tests/migration/guestperf/shell.py @@ -26,6 +26,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), import argparse import fnmatch import platform +import logging from guestperf.hardware import Hardware from guestperf.engine import Engine @@ -147,6 +148,10 @@ class Shell(BaseShell): def run(self, argv): args = self._parser.parse_args(argv) + logging.basicConfig(level=(logging.DEBUG if args.debug else + logging.INFO if args.verbose else + logging.WARN)) + engine = self.get_engine(args) hardware = self.get_hardware(args) @@ -179,6 +184,10 @@ class BatchShell(BaseShell): def run(self, argv): args = self._parser.parse_args(argv) + logging.basicConfig(level=(logging.DEBUG if args.debug else + logging.INFO if args.verbose else + logging.WARN)) + engine = self.get_engine(args) hardware = self.get_hardware(args) @@ -231,6 +240,10 @@ class PlotShell(object): def run(self, argv): args = self._parser.parse_args(argv) + logging.basicConfig(level=(logging.DEBUG if args.debug else + logging.INFO if args.verbose else + logging.WARN)) + if len(args.reports) == 0: print >>sys.stderr, "At least one report required" -- cgit v1.2.3