From patchwork Thu Mar 8 17:03:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 7177 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 735F623E3E for ; Thu, 8 Mar 2012 17:03:16 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id E35EFA18614 for ; Thu, 8 Mar 2012 17:03:15 +0000 (UTC) Received: by iage36 with SMTP id e36so1247472iag.11 for ; Thu, 08 Mar 2012 09:03:15 -0800 (PST) Received: by 10.42.145.72 with SMTP id e8mr6176760icv.0.1331226195335; Thu, 08 Mar 2012 09:03:15 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp14894ibg; Thu, 8 Mar 2012 09:03:13 -0800 (PST) Received: by 10.180.82.132 with SMTP id i4mr36812207wiy.12.1331226192483; Thu, 08 Mar 2012 09:03:12 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id h56si3299326wed.20.2012.03.08.09.03.11 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Mar 2012 09:03:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1S5gkB-0001Gx-L7 for ; Thu, 08 Mar 2012 17:03:11 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 8B1CBE0464 for ; Thu, 8 Mar 2012 17:03:11 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-test X-Launchpad-Branch: ~linaro-validation/lava-test/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 127 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-test/trunk] Rev 127: Merge support for --vebose Message-Id: <20120308170311.20957.15377.launchpad@ackee.canonical.com> Date: Thu, 08 Mar 2012 17:03:11 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14914"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: dff7dc45ae1d12e15e5dc63dc77f285854678b17 X-Gm-Message-State: ALoCoQmCU1RMN1kMb8YAX84pazaokA3qce9RfPud3WvKjRhY1jGL4YBDtfYUTAclcqhhaKbSeZKn Merge authors: Le Chi Thu le.chi.thu@linaro.org Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 127 [merge] committer: Zygmunt Krynicki branch nick: trunk timestamp: Thu 2012-03-08 17:59:45 +0100 message: Merge support for --vebose modified: doc/changes.rst lava_test/commands.py lava_test/core/config.py lava_test/main.py --- lp:lava-test https://code.launchpad.net/~linaro-validation/lava-test/trunk You are subscribed to branch lp:lava-test. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-test/trunk/+edit-subscription === modified file 'doc/changes.rst' --- doc/changes.rst 2012-03-08 10:21:25 +0000 +++ doc/changes.rst 2012-03-08 16:59:15 +0000 @@ -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' --- lava_test/commands.py 2012-03-06 17:54:26 +0000 +++ lava_test/commands.py 2012-03-05 21:43:48 +0000 @@ -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' --- lava_test/core/config.py 2011-09-13 20:25:06 +0000 +++ lava_test/core/config.py 2012-03-05 21:43:48 +0000 @@ -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' --- lava_test/main.py 2012-02-07 22:26:47 +0000 +++ lava_test/main.py 2012-03-05 21:43:48 +0000 @@ -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 = '%(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 = '%(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)