adb logcat binary mode ignores filterspecs?

308 Views Asked by At

In adb shell

$ logcat -B -s MyTag
$ logcat -B MyTag:I *:S

Above two commands receive logs only tag MyTag in binary stream. But it seems to ignore filterspecs argument only in binary mode.

I cannot find any clue to be ignored at logcat.cpp code

Is it possible to apply filterspec with -B binary format?

1

There are 1 best solutions below

0
Alex P. On BEST ANSWER

The logcat code is pretty clear:

if (context->printBinary) {
    printBinary(context, &log_msg);
} else {
    processBuffer(context, dev, &log_msg);
}

If context->printBinary is set to 1 by specifying the -B parameter - the printBinary() is invoked, which does not do any additional processing (like filtering).