0

I have a method to call Log.d that I use throughout an app for debugging. I noticed that there is an Edit Filter Configuration option in the Logcat submenu there which lets me create a custom filter for a specific Log TAG.

menu1

menu2

menu3

Below is the method I use to call the Log.d. I have tried to add it myself but it didn't show them in the Logcat.

private static final String TAG = "LOG ENTRY: ";
public void LOG_ENTRY(String what) {
     Log.d(TAG, what);
}

Does anyone know how to implement this step by step? Is it also possible to include the error messages in the custom filter?

Zoe
  • 27,060
  • 21
  • 118
  • 148
M A F
  • 291
  • 4
  • 14

2 Answers2

1

In the attached image (Android Studio "Create New Logcat Filter" dialog) in the question, enter the following values,

Filter name: Any name as per your preference. In Log Tag field: "LOG ENTRY: " (The Log TAG)(Without the double quotes) In Package Name: Enter the package name of your application. In Log Level: Select the "debug" option from the drop-down, since you are using Log.d which is for debugging. PID & Log message fields can be empty.

You can uncheck the regex option in all the 3 checkboxes.

This should let you filter the logcat as per your requirement.

Abhimanyu
  • 11,351
  • 7
  • 51
  • 121
0

I was able to solve this by switching the Log Level to verbose and removing the space from the TAG.

private static final String TAG = "LOG";
    public void LOG_ENTRY(String what) {
        Log.d(TAG, what);
    }

custom filter

M A F
  • 291
  • 4
  • 14