mirror of
https://github.com/imcarlost/pidcat-repl.git
synced 2026-08-08 23:17:43 -04:00
Merge pull request #68 from adstro/master
Add support for tag(s) filtering
This commit is contained in:
@@ -39,6 +39,7 @@ parser.add_argument('-s', '--serial', dest='device_serial', help='Device serial
|
|||||||
parser.add_argument('-d', '--device', dest='use_device', action='store_true', help='Use first device for log input (adb -d option).')
|
parser.add_argument('-d', '--device', dest='use_device', action='store_true', help='Use first device for log input (adb -d option).')
|
||||||
parser.add_argument('-e', '--emulator', dest='use_emulator', action='store_true', help='Use first emulator for log input (adb -e option).')
|
parser.add_argument('-e', '--emulator', dest='use_emulator', action='store_true', help='Use first emulator for log input (adb -e option).')
|
||||||
parser.add_argument('-c', '--clear', dest='clear_logcat', action='store_true', help='Clear the entire log before running.')
|
parser.add_argument('-c', '--clear', dest='clear_logcat', action='store_true', help='Clear the entire log before running.')
|
||||||
|
parser.add_argument('-t', '--tag', dest='tag', action='append', help='Filter output by specified tag(s)')
|
||||||
|
|
||||||
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()]
|
||||||
@@ -269,6 +270,8 @@ while adb.poll() is None:
|
|||||||
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
|
||||||
|
if args.tag and tag.strip() not in args.tag:
|
||||||
|
continue
|
||||||
|
|
||||||
linebuf = ''
|
linebuf = ''
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user