=== modified file 'doc/changes.rst'
@@ -12,6 +12,7 @@
* Improved error output when running inside virtualenv where the apt and
lsb_release modules are not visible to python.
* Enabled URL cache used by the ``lava-test register`` command.
+ * Add command line switch ``--verbose`` that turns on lots of messages
.. _version_0_4:
=== modified file 'lava_test/commands.py'
@@ -36,9 +36,17 @@
self._config = get_config()
self._test_loader = TestLoader(self._config)
+ if self.args.verbose:
+ logging.root.setLevel(logging.DEBUG)
+
@classmethod
def register_arguments(cls, parser):
parser.add_argument(
+ "-v", "--verbose",
+ action="store_true",
+ default=False,
+ help="Be verbose about undertaken actions")
+ parser.add_argument(
"-q", "--quiet",
action="store_true",
default=False,
=== modified file 'lava_test/core/config.py'
@@ -75,13 +75,6 @@
provider_info["config"] = {}
return provider_info["config"]
- def get_logging_config_file(self):
- logging_file = os.path.join(self.configdir, "logging.conf")
- if os.path.exists(logging_file):
- return logging_file
- else:
- return None
-
_config = None
=== modified file 'lava_test/main.py'
@@ -34,17 +34,11 @@
def main():
-
- logging_config_file = get_config().get_logging_config_file()
-
- if logging_config_file != None:
- logging.config.fileConfig(logging_config_file)
- else:
- # config the python logging
- FORMAT = '<LAVA_TEST>%(asctime)s %(levelname)s: %(message)s'
- DATEFMT= '%Y-%m-%d %I:%M:%S %p'
- logging.basicConfig(format=FORMAT,datefmt=DATEFMT)
- logging.root.setLevel(logging.ERROR)
+ # default logging level is warning. -v or --verbose will change it to debug (in Command class).
+ FORMAT = '<LAVA_TEST>%(asctime)s %(levelname)s: %(message)s'
+ DATEFMT= '%Y-%m-%d %I:%M:%S %p'
+ logging.basicConfig(format=FORMAT,datefmt=DATEFMT)
+ logging.root.setLevel(logging.WARNING)
run_with_dispatcher_class(LAVATestDispatcher)