How To Filter Only My Application Log In Intellij's Logcat?
Solution 1:
Filtering based on an application (package) is not available in IntelliJ IDEA (current version: 12).
Solution 2:
EDIT: Everything above the horizontal rule is my new answer (updated 5/17/13):
I'd suggest moving over to the new Android Studio IDE (which is based of IntelliJ). This allows filtering by package name.
You can vote for the feature to be added here: http://youtrack.jetbrains.com/issue/IDEA-95780
In the meantime, you may think about wrapping the Android Log class to add a suffix/prefix that you could then filter by. Something like the following:
/**
* Wrapper for the Android {@link Log} class.
* <br><br>
* The primary reason for doing this is to add a unique prefix to all tags for easier filtering
* in IntelliJ IDEA (since in v12 there is no way to filter by application).
*
* @authorgloesch
*/publicclassLogger {
privatestatic final StringFILTER = "(MY APP) ";
publicstaticvoidd(String tag, String message) {
Log.d(tag.concat(FILTER), message);
}
publicstaticvoidi(String tag, String message) {
Log.i(tag.concat(FILTER), message);
}
publicstaticvoidv(String tag, String message) {
Log.v(tag.concat(FILTER), message);
}
publicstaticvoide(String tag, String message) {
Log.e(tag.concat(FILTER), message);
}
publicstaticvoidw(String tag, String message) {
Log.w(tag.concat(FILTER), message);
}
publicstaticvoidwtf(String tag, String message) {
Log.wtf(tag.concat(FILTER), message);
}
}
Solution 3:
You can filter by the process ID (PID):
The only drawback is that PID changes and you will have to adjust the filter after every app restart.
Solution 4:
Depends on what you're trying to do. In the logcat window, you should have an [non]empty window named "Filters" with a +
or -
next to it (as it appears in IntelliJ IDEA 12) and it'll pop up a window like this:
If the Log Tag isn't what you need, you can filter based on a regexp in the log message itself (e.g. if the message always starts with seek error
, then input seek
and it should find it. If you set Log Level to Verbose it should match anything that gets written to logcat.
Post a Comment for "How To Filter Only My Application Log In Intellij's Logcat?"