OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Shutdown adb_logcat_monitor and print accumulated logs. | 7 """Shutdown adb_logcat_monitor and print accumulated logs. |
8 | 8 |
9 To test, call './adb_logcat_printer.py <base_dir>' where | 9 To test, call './adb_logcat_printer.py <base_dir>' where |
10 <base_dir> contains 'adb logcat -v threadtime' files named as | 10 <base_dir> contains 'adb logcat -v threadtime' files named as |
11 logcat_<deviceID>_<sequenceNum> | 11 logcat_<deviceID>_<sequenceNum> |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 logger.info('Done.') | 193 logger.info('Done.') |
194 sh.flush() | 194 sh.flush() |
195 output_file.write('\nLogcat Printer Event Log\n') | 195 output_file.write('\nLogcat Printer Event Log\n') |
196 output_file.write(log_stringio.getvalue()) | 196 output_file.write(log_stringio.getvalue()) |
197 | 197 |
198 if __name__ == '__main__': | 198 if __name__ == '__main__': |
199 if len(sys.argv) == 1: | 199 if len(sys.argv) == 1: |
200 print 'Usage: %s <base_dir>' % sys.argv[0] | 200 print 'Usage: %s <base_dir>' % sys.argv[0] |
201 sys.exit(1) | 201 sys.exit(1) |
202 sys.exit(main(sys.argv[1], sys.stdout)) | 202 sys.exit(main(sys.argv[1], sys.stdout)) |
OLD | NEW |