Android LogCat Filter for multiple tags in Eclipse

前端 未结 7 1094
南方客
南方客 2021-01-30 04:07

Clicked on create filter could not figure out from docs how to create a filter for say two or more tags. If I have two tags com.test.TestClassA and com.test

相关标签:
7条回答
  • 2021-01-30 04:30

    On Feb 12, 2:58 am, AndroidDevTime wrote:

    If I have two tags com.test.TestClassA and com.test.TestClassB how do I create a filter that shows log for both of these classes?

    The "Log tag" field accepts Java regular expressions, so do this:

    ^com.test.TestClassA$|^com.test.TestClassB$

    which matches exactly those tags you specified. You could be more economical/efficient/whatever with the regular expression, depending on how much you want to muck around with that.

    0 讨论(0)
  • 2021-01-30 04:30

    It is not possible right now. @see http://groups.google.com/group/android-developers/browse_thread/thread/17356ef7bdf1550f?pli=1 I also wish it were...

    0 讨论(0)
  • 2021-01-30 04:30

    I just do it from the command line. Having a different terminal for each adb filter. Then if you line them up side by side you can get a good idea of what is happening.

    0 讨论(0)
  • 2021-01-30 04:32

    Use proclogcat: http://devtcg.blogspot.com/2010/04/logcat-improved.html

    It lets you filter by your package name instead.

    0 讨论(0)
  • 2021-01-30 04:41

    The only way I have seen is Create a Filter using PID so that evey log message of your application will be displayed in that Filter. I wonder if this is possible through tag names in the current version of the ADT for eclipse.

    0 讨论(0)
  • 2021-01-30 04:48

    As pointed by Brain Reinhold you can combine tag filters with vertical bar | (which obviously means logical "OR"). You can also use that (as well as other Regex) syntax in the logcat search box (by preceding tags with tag: prefix):

    tag:com.test.TestClassA|com.test.TestClassB

    More complex filtering is also possible. For example here is the search filter that displays messages from either android.process.media or com.android.camera apps, which have at least one digit (\d) in the message text and are tagged with either dalvikvm or AndroidRuntime tags:

    app:android.process.media|com.android.camera tag:dalvikvm|AndroidRuntime text:\d

    One short and useful filter is tag:^(?!dalvikvm) which removes all those noisy Dalvik logs.

    It's also worth mentioning that you can quickly disable any part of the filter by placing vertical bar at the end of the part you wish to disable (e.g. placing | right after app:android.process.media|com.android.camera in the example above effectively disables filtering by application name while still preserving filtering by tags and text).

    0 讨论(0)
提交回复
热议问题