mirror of
https://github.com/imcarlost/pidcat-repl.git
synced 2026-08-08 23:17:43 -04:00
@@ -30,7 +30,7 @@ import termios
|
||||
import struct
|
||||
|
||||
parser = argparse.ArgumentParser(description='Filter logcat by package name')
|
||||
parser.add_argument('package', help='Application package name')
|
||||
parser.add_argument('package', nargs='+', help='Application package name(s)')
|
||||
parser.add_argument('--tag-width', metavar='N', dest='tag_width', type=int, default=22, help='Width of log tag')
|
||||
parser.add_argument('--color-gc', dest='color_gc', action='store_true', help='Color garbage collection')
|
||||
|
||||
@@ -132,17 +132,17 @@ def parse_death(tag, message):
|
||||
kill = PID_KILL.match(message)
|
||||
if kill:
|
||||
pid = kill.group(1)
|
||||
if kill.group(2) == args.package and pid in pids:
|
||||
if kill.group(2) in args.package and pid in pids:
|
||||
return pid
|
||||
leave = PID_LEAVE.match(message)
|
||||
if leave:
|
||||
pid = leave.group(2)
|
||||
if leave.group(1) == args.package and pid in pids:
|
||||
if leave.group(1) in args.package and pid in pids:
|
||||
return pid
|
||||
death = PID_DEATH.match(message)
|
||||
if death:
|
||||
pid = death.group(2)
|
||||
if death.group(1) == args.package and pid in pids:
|
||||
if death.group(1) in args.package and pid in pids:
|
||||
return pid
|
||||
return None
|
||||
|
||||
@@ -166,7 +166,7 @@ while True:
|
||||
if start is not None:
|
||||
line_package, target, line_pid, line_uid, line_gids = start.groups()
|
||||
|
||||
if line_package == args.package:
|
||||
if line_package in args.package:
|
||||
pids.add(line_pid)
|
||||
|
||||
linebuf = colorize(' ' * (header_size - 1), bg=WHITE)
|
||||
|
||||
Reference in New Issue
Block a user