Merge branch 'master' into 8183-projects-dropdown
[arvados.git] / tools / crunchstat-summary / crunchstat_summary / command.py
index a1e3eb2165d0c9ee1b2db13792fdb7cdfd0361de..78638c60e840b48e2117af842fc472e02d109daa 100644 (file)
@@ -13,7 +13,8 @@ class ArgumentParser(argparse.ArgumentParser):
         src = self.add_mutually_exclusive_group()
         src.add_argument(
             '--job', type=str, metavar='UUID',
-            help='Look up the specified job and read its log data from Keep')
+            help='Look up the specified job and read its log data from Keep'
+            ' (or from the Arvados event log, if the job is still running)')
         src.add_argument(
             '--pipeline-instance', type=str, metavar='UUID',
             help='Summarize each component of the given pipeline instance')
@@ -27,20 +28,14 @@ class ArgumentParser(argparse.ArgumentParser):
             '--format', type=str, choices=('html', 'text'), default='text',
             help='Report format')
         self.add_argument(
-            '--verbose', action='store_true',
-            help='Write progress messages to stderr')
-        self.add_argument(
-            '--debug', action='store_true',
-            help='Write debug messages to stderr')
+            '--verbose', '-v', action='count', default=0,
+            help='Log more information (once for progress, twice for debug)')
 
 
 class Command(object):
     def __init__(self, args):
         self.args = args
-        if args.debug:
-            logger.setLevel(logging.DEBUG)
-        elif args.verbose:
-            logger.setLevel(logging.INFO)
+        logger.setLevel(logging.WARNING - 10 * args.verbose)
 
     def run(self):
         kwargs = {