如何在 Android Studio 中过滤 logcat? [英] How to filter logcat in Android Studio?

查看:96
本文介绍了如何在 Android Studio 中过滤 logcat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 logcat 中有太多输出,所以我想使用一些关键字对其进行过滤,基本上只显示包含关键字的输出.有没有办法通过 UI 在 Android Studio 中做到这一点?

In my logcat there is too much output, so I'd like to filter it using some keywords, basically displaying only the output containing the keyword(s). Is there a way to do that in Android Studio through the UI?

推荐答案

有两种方法可以做到这一点,都在 IDE 底部的 Android 选项卡中(显示 logcat 输出的地方).

There are two ways to do this, both are in the Android tab at the bottom of the IDE (where the logcat output is displayed).

首先,您可以简单地在顶部的搜索框中输入一些内容,它应该只过滤包含您输入的文本的消息.

First, you can simply type something into the search box at the top and it should filter only messages containing the text you type.

其次,您可以通过单击右上角的下拉菜单进行高级过滤,默认情况下应该显示无过滤器,然后选择编辑过滤器配置并指定过滤什么.使用此方法,您还可以保存过滤器,并可以通过在下拉列表中选择它们来重复使用它们.

Second, you can do advanced filtering by clicking on the dropdown at the top right, which should be displaying No Filters by default, and choose Edit Filter Configuration and specifying what to filter on. Using this method you also save the filters and can re-use them by selecting them in the dropdown.

截图:

这篇关于如何在 Android Studio 中过滤 logcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆