[AndroidStudio] The new version of Androidstudio logcat filter settings

The filtering in the new version is not as simple as before, but it is more functional; the old version can only filter a package name, or a TAG, or a keyword, and the new version can filter on demand. Let’s talk about the specific use of filtering

1. Filter by package name:

//输入package:(输入一个p就会有提示的) ,+ 你的包名
package:com.test.test

insert image description here

2. Filter by log level

// 输入level: ,后面加上等级,如info,debug,warning等
// 当等级为Info时,过滤Info及以上的日志
level:debug 

insert image description here

3. Filter by Tag

// 输入tag: ,后面跟上你要过滤的TAG,此功能同老版本的AS
tag:TAG

insert image description here

4. Filter by keyword

// 输入message:  +过滤的关键字
message:KW 

insert image description here

5. Combined filtering

The above combinations can be combined at will, and the rules are the same as above

6. Regular expression filtering

// 只有这些字段支持正则表达式:tag、package、message、line
// 正则表达式匹配通过在字段名称中附加 ~ 来表示。例如 tag~:Test[\S]*。
tag~:Test[\S]*

7. Time filtering

// age是过滤最近时间段内的日志,s 表示秒,m 表示分钟,h 表示小时,d 表示天。
// 下面的例子是过滤过去 5 分钟内记录的消息。
age:5m

8. Reverse filtering

// 过滤不想看的日志
// 否定的表示方式是在字段名称前面加上 -
-tag:Test

Guess you like

Origin blog.csdn.net/mingtiannihao0522/article/details/132204737