-1

How can I create a filter in Android Studio to view only V/ and D/ (Verbose and Debug) Logs only. Currently I can select only one at a time.

Alternatively, is there an adb command to capture Debug and Verbose level logs messages only?

UPDATE :

I am developing a power manager Android Application and want to trace down from lower layer (Androdi Framework) to Application level logs .My application shows V/(verbose) logs while there is D/BatteryService Logs , I just want V/ and D/ logs .SO I was wondering if I can gather only these two types -(V/ and D/) and Subtypes (MyAPP and BatteryService) of logs using Android Studio. If not from Android Studio, then the coresponding adb command for console.

Raulp
  • 7,758
  • 20
  • 93
  • 155

1 Answers1

0

The priority based filters in logcat (as in many other logging systems) do not mean to limit the filtered messages to a single priority level. Instead they set the lowest level to show.

adb logcat -s *:D is not going to show debug messages only - it will show debug , info, warning, error and fatal messages. But not verbose because it is lower level than debug

I do not see the use case for what you are asking. But you could just grep for whatever combination of priority levels you want:

adb logcat -v tag | grep -E '^(V|D)/'
Alex P.
  • 30,437
  • 17
  • 118
  • 169
  • Update the Use case in the Question. – Raulp Jan 19 '17 at 04:00
  • @Raulp, your use case does not explain why you want to filter by priorities. In your case you should just filter by 2 tags and ignore the priorities: `adb logcat -s MyAPP:* BatteryService:*` – Alex P. Jan 19 '17 at 05:36