Ignoring some logs in Logcat filter – Android Studio – solution

Here is a little help to remove from our logcat some logs we don’t want like: dalvikvm or OpenGL
All what you need is to click in top right corner of logcat, select our package name and click Edit Filter Configuration


Then in the field called Log Tag regex You need insert this
^((?!(?:dalvikvm|OpenGLRenderer)).)*$ which means you don’t want any log which contains dalvivm or OpenGLRenderer. If You want add another word to ignore list just insert inside of regex


For example:

Android source code from grepcode.com + Notepad++ with regex

Did You have problem with copying text from grepcode? Did You have problem with a lot spaces and wrong formatting?
Well it is possible to reformat that text with two commands using regex in notepad.

Let’s say we have this:



public void [More ...] setButtonDrawable(int resid) {


if (resid != 0 && resid == mButtonResource) {





It is possible to convert original source to better format like this:

public void setButtonDrawable(int resid) {
if (resid != 0 && resid == mButtonResource) {
mButtonResource = resid;
Drawable d = null;
if (mButtonResource != 0) {
d = getResources().getDrawable(mButtonResource);


You have to paste Your selected code to Notepad++, then click CTRL+H (for replacing function). Select at the bottom option for regex. And finally make two replacing steps:
1. replace from \d+\s+\r\n to (empty text here)
1. replace from ^[\s+][\r\n$] to (empty text here)

And that’s it!