| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Wrapper for adding logdog streaming support to swarming tasks.""" | 6 """Wrapper for adding logdog streaming support to swarming tasks.""" |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 import logging | 9 import logging |
| 10 import os | 10 import os |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 args.name) | 68 args.name) |
| 69 logdog_cmd = [args.logdog_bin_cmd, '-project', args.project, | 69 logdog_cmd = [args.logdog_bin_cmd, '-project', args.project, |
| 70 '-output', 'logdog,host=%s' % args.logdog_server, | 70 '-output', 'logdog,host=%s' % args.logdog_server, |
| 71 '-prefix', args.prefix, | 71 '-prefix', args.prefix, |
| 72 '-service-account-json', args.service_account_json, | 72 '-service-account-json', args.service_account_json, |
| 73 'stream', '-source', args.source, | 73 'stream', '-source', args.source, |
| 74 '-stream', '-name=%s' % args.name] | 74 '-stream', '-name=%s' % args.name] |
| 75 | 75 |
| 76 if not os.path.exists(args.logdog_bin_cmd): | 76 if not os.path.exists(args.logdog_bin_cmd): |
| 77 logging.error( | 77 logging.error( |
| 78 'Logfog binary %s unavailable. Unable to upload logcats.', | 78 'Logdog binary %s unavailable. Unable to upload logcats.', |
| 79 args.logdog_bin_cmd) | 79 args.logdog_bin_cmd) |
| 80 elif not os.path.exists(args.source): | 80 elif not os.path.exists(args.source): |
| 81 logging.error( | 81 logging.error( |
| 82 'Logcat sources not found at %s. Unable to upload logcats.', | 82 'Logcat sources not found at %s. Unable to upload logcats.', |
| 83 args.source) | 83 args.source) |
| 84 else: | 84 else: |
| 85 subprocess.call(logdog_cmd) | 85 subprocess.call(logdog_cmd) |
| 86 logging.info('Logcats are located at: %s', url) | 86 logging.info('Logcats are located at: %s', url) |
| 87 return result | 87 return result |
| 88 | 88 |
| 89 | 89 |
| 90 if __name__ == '__main__': | 90 if __name__ == '__main__': |
| 91 sys.exit(main()) | 91 sys.exit(main()) |
| OLD | NEW |