Add -a/--all flag for showing all logs.

This commit is contained in:
rxwen
2015-08-22 15:05:56 -05:00
committed by Jake Wharton
parent 8e326454a2
commit 0ef40cce9b
+5 -1
View File
@@ -45,6 +45,7 @@ parser.add_argument('-c', '--clear', dest='clear_logcat', action='store_true', h
parser.add_argument('-t', '--tag', dest='tag', action='append', help='Filter output by specified tag(s)')
parser.add_argument('-i', '--ignore-tag', dest='ignored_tag', action='append', help='Filter output by ignoring specified tag(s)')
parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __version__, help='Print the version number and exit')
parser.add_argument('-a', '--all', dest='all', action='store_true', default=False, help='Print all log messages')
args = parser.parse_args()
min_level = LOG_LEVELS_MAP[args.min_level.upper()]
@@ -65,6 +66,9 @@ if args.current_app:
running_package_name = re.search(".*TaskRecord.*A[= ]([^ ^}]*)", system_dump).group(1)
package.append(running_package_name)
if len(package) == 0:
args.all = True
# Store the names of packages for which to match all processes.
catchall_package = filter(lambda package: package.find(":") == -1, package)
# Store the name of processes to match exactly.
@@ -318,7 +322,7 @@ while adb.poll() is None:
message = message.lstrip()
owner = app_pid
if owner not in pids:
if not args.all and owner not in pids:
continue
if level in LOG_LEVELS_MAP and LOG_LEVELS_MAP[level] < min_level:
continue