mirror of
https://github.com/imcarlost/pidcat-repl.git
synced 2026-08-08 23:17:43 -04:00
Add -a/--all flag for showing all logs.
This commit is contained in:
@@ -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('-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('-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('-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()
|
args = parser.parse_args()
|
||||||
min_level = LOG_LEVELS_MAP[args.min_level.upper()]
|
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)
|
running_package_name = re.search(".*TaskRecord.*A[= ]([^ ^}]*)", system_dump).group(1)
|
||||||
package.append(running_package_name)
|
package.append(running_package_name)
|
||||||
|
|
||||||
|
if len(package) == 0:
|
||||||
|
args.all = True
|
||||||
|
|
||||||
# Store the names of packages for which to match all processes.
|
# Store the names of packages for which to match all processes.
|
||||||
catchall_package = filter(lambda package: package.find(":") == -1, package)
|
catchall_package = filter(lambda package: package.find(":") == -1, package)
|
||||||
# Store the name of processes to match exactly.
|
# Store the name of processes to match exactly.
|
||||||
@@ -318,7 +322,7 @@ while adb.poll() is None:
|
|||||||
message = message.lstrip()
|
message = message.lstrip()
|
||||||
owner = app_pid
|
owner = app_pid
|
||||||
|
|
||||||
if owner not in pids:
|
if not args.all and owner not in pids:
|
||||||
continue
|
continue
|
||||||
if level in LOG_LEVELS_MAP and LOG_LEVELS_MAP[level] < min_level:
|
if level in LOG_LEVELS_MAP and LOG_LEVELS_MAP[level] < min_level:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user