When using Android devices (especially real machines) for program testing, when viewing Logcat, some useless logs (such as JDWP's information) are printed along with the log we are interested in, which can be inconvenient for viewing logs in real time. Fortunately, the Log search in Android Studio allows regular expressions to match the search. Using regular expressions to filter out useless keywords is a relatively lightweight way to protect yourself from brush screens. Matches a regular expression that does not contain a specific keyword as follows:
^(?!. * Keyword 1) (?!. * Keyword 2) (?!. * Keyword 3)
where ^ represents the beginning of a line; * used to indicate that the keyword may have other characters before it.
For example, the following regular expression filters out all logs that contain jdwp:
^(?!. *JDWP)
The following regular expression filters out all logs that contain jdwp or Dalvik or LIBEGL:
^(?!. *JDWP) (?!. *dalvik) (?!. *LIBEGL)
Reference: mismatches in regular expressions
Flaris Original
Reprint please indicate the source
Http://www.cnblogs.com/flaris
Http://www.zhihu.com/people/flaris
Use regular expressions to filter useless logs when Android is debugged