| Index: build/android/adb_logcat_printer.py
|
| diff --git a/build/android/adb_logcat_printer.py b/build/android/adb_logcat_printer.py
|
| index 55176ab9201333745d63f878bcdcb68118efe95a..a715170759d8bf0e6206a0b2da255789fccfdc72 100755
|
| --- a/build/android/adb_logcat_printer.py
|
| +++ b/build/android/adb_logcat_printer.py
|
| @@ -159,10 +159,6 @@ def main(argv):
|
| if len(args) != 1:
|
| parser.error('Wrong number of unparsed args')
|
| base_dir = args[0]
|
| - if options.output_path:
|
| - output_file = open(options.output_path, 'w')
|
| - else:
|
| - output_file = sys.stdout
|
|
|
| log_stringio = cStringIO.StringIO()
|
| logger = logging.getLogger('LogcatPrinter')
|
| @@ -172,6 +168,19 @@ def main(argv):
|
| ' %(message)s'))
|
| logger.addHandler(sh)
|
|
|
| + if options.output_path:
|
| + if not os.path.exists(os.path.dirname(options.output_path)):
|
| + logger.warning('Output dir %s doesn\'t exist. Creating it.',
|
| + os.path.dirname(options.output_path))
|
| + os.makedirs(os.path.dirname(options.output_path))
|
| + output_file = open(options.output_path, 'w')
|
| + logger.info('Dumping logcat to local file %s. If running in a build, '
|
| + 'this file will likely will be uploaded to google storage '
|
| + 'in a later step. It can be downloaded from there.',
|
| + options.output_path)
|
| + else:
|
| + output_file = sys.stdout
|
| +
|
| try:
|
| # Wait at least 5 seconds after base_dir is created before printing.
|
| #
|
|
|