Logcat provides several default filter options (Verbose, Info, Debug etc) and a simple pattern match filter, but the regex filter is the most powerful option for customizing logcat output. Here, I provide 3 useful patterns that have been frequently used to search the logcat more efficiently.
where logcat will only show lines containing the expressions separated by "|" (case-insensitive).
For example, "logging" may be a unique log identifier for your application, and FA is the output from the Firebase Analytics library
here, we find logs that match FA exactly e.g. FA, FA-SVC from the Firebase Analytics library, and not any line that includes FA, Fa, fa etc
Alternatively, if we want to display most of the logs (because we want to observe any unexpected library crashes or device warnings), it is better to EXCLUDE only those messages we can confidently ignore for the current session.
- E/ corresponds to Error messages, I/ corresponds to Info messages, etc..
- Wifi, audio_hw_extn corresponds to any message containing these common keywords
Examples of message sources that frequent pollute the logcat and may not be useful for debugging include:
- FA|FA-SVC (verbose logging from Firebase Analytics, if not disabled in the application code)
One could also copy their un-filtered logcat to an online text analyzer e.g. https://www.online-utility.org/text/analyzer.jsp to find the most common sources of logs.