add verbose mode to graph cmd

This adds a verbose mode to the graph command which makes it much
easier to see progress while working with it. Uses the new common
logging extraction.

Change-Id: Ib583ac8b3938af75ed285f34e3f0a95589bb094b
This commit is contained in:
Sean Dague 2014-09-26 13:14:19 -04:00
parent 0fd2c4508a
commit 0fb8777bf9

View File

@ -24,12 +24,15 @@ from launchpadlib import launchpad
import requests
import elastic_recheck.elasticRecheck as er
from elastic_recheck import log as logging
from elastic_recheck import results as er_results
STEP = 3600000
LPCACHEDIR = os.path.expanduser('~/.launchpadlib/cache')
LOG = logging.getLogger('ergraph')
def get_launchpad_bug(bug):
lp = launchpad.Launchpad.login_anonymously('grabbing bugs',
@ -69,6 +72,9 @@ def main():
help='output filename')
parser.add_argument('-q', dest='queue',
help='limit results to a specific query')
parser.add_argument('-v', dest='verbose',
action='store_true', default=False,
help='print out details as we go')
args = parser.parse_args()
classifier = er.Classifier(args.queries)
@ -94,6 +100,8 @@ def main():
args.queue)
if query.get('suppress-graph'):
continue
if args.verbose:
LOG.debug("Starting query for bug %s" % query['bug'])
urlq = dict(search=query['query'],
fields=[],
offset=0,