提交 8af09b80 编写于 作者: E Eduardo Habkost

guestperf: Configure logging on all shell frontends

The logging module will eventually replace the 'debug' parameter
in QEMUMachine and QEMUMonitorProtocol.

Cc: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
Message-Id: <20171005172013.3098-2-ehabkost@redhat.com>
Reviewed-by: NLukáš Doktor <ldoktor@redhat.com>
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
上级 fb3b4e6d
...@@ -26,6 +26,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), ...@@ -26,6 +26,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__),
import argparse import argparse
import fnmatch import fnmatch
import platform import platform
import logging
from guestperf.hardware import Hardware from guestperf.hardware import Hardware
from guestperf.engine import Engine from guestperf.engine import Engine
...@@ -147,6 +148,10 @@ class Shell(BaseShell): ...@@ -147,6 +148,10 @@ class Shell(BaseShell):
def run(self, argv): def run(self, argv):
args = self._parser.parse_args(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) engine = self.get_engine(args)
hardware = self.get_hardware(args) hardware = self.get_hardware(args)
...@@ -179,6 +184,10 @@ class BatchShell(BaseShell): ...@@ -179,6 +184,10 @@ class BatchShell(BaseShell):
def run(self, argv): def run(self, argv):
args = self._parser.parse_args(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) engine = self.get_engine(args)
hardware = self.get_hardware(args) hardware = self.get_hardware(args)
...@@ -231,6 +240,10 @@ class PlotShell(object): ...@@ -231,6 +240,10 @@ class PlotShell(object):
def run(self, argv): def run(self, argv):
args = self._parser.parse_args(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: if len(args.reports) == 0:
print >>sys.stderr, "At least one report required" print >>sys.stderr, "At least one report required"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册