def _FetchLog(http_client, log_url, output_file, callback):
 def _OnFetch(response):
  if (response.code == 200):
   with open(output_file, 'w') as f:
    f.write(response.body)
    logging.info(('wrote %d bytes to %s' % (len(response.body), output_file)))
  else:
   logging.error(('failed to fetch %s' % log_url))
  callback()
 http_client.fetch(log_url, callback=_OnFetch, method='GET')

def _FetchLog ( http_client , log_url , output_file , callback ) : def _OnFetch ( response ) : if ( response . code == 200 ) : with open ( output_file , 'w' ) as f : f . write ( response . body ) logging . info ( ( 'wrote %d bytes to %s' % ( len ( response . body ) , output_file ) ) ) else : logging . error ( ( 'failed to fetch %s' % log_url ) ) callback ( ) http_client . fetch ( log_url , callback = _OnFetch , method = 'GET' )
fetches the log file at "log_url" and stores it in "output_file" .