Flutter disable system debug messages in Run Tab

情到浓时终转凉″ 提交于 2020-05-23 04:54:08

问题


I use:

print('Pls. show this line only');

to debug my flutter apps developed by Android Studio. However, the output in the [Run Tab] is usually something like:

Tens/Hundreds of system debug messages
I/flutter ( 9154): Pls. show this line only
Tens/Hundreds of system debug messages

OK, sometimes it takes me minutes to find my own debug message [Pls. show this line only].

My question is simple, how can we disable [Tens/Hundreds of system debug messages] in the Run Tab of Flutter Project in Android Studio?

Meanwhile, I am using:

print('***************************************************** Pls. show this line only');

as a work around.


回答1:


Select the option as shown in case IntelliJ IDEs or Android Studio

Now you can filter as follows




回答2:


In Android Studio....

Before

Settings

File > Settings > Editor > General > Console

Look for section:

Fold console lines that contain

Click the + button on right hand side of scrollable list

Add your substring of what you'd like hidden from the Console output. For example in Flutter, I'd remove D/ (i.e. letter D + forward slash) which are emulator debug messages.

After





回答3:


In Android Studio:

  • select text you want to ignore in the console
  • Right-click it
  • Fold lines like this

    Android Studio Flutter Console folding




回答4:


I Finally found a Workaround For VS code this is NOT permanent so you have to do it once per session but it helps a lot ...

there is a hidden feature in vs code for debug log filtering and all you need to do is to filter the log to have only the flutter related logs as follows :

1) focus on debug console (by clicking on it )

2) click ctrl + f (nothing will appear but you are now in filtering mode)

3) Type "I/Flutter"

4) hover on the word and click the icon next to it to make it stick .

that's it !

Before :

After:



来源:https://stackoverflow.com/questions/55437643/flutter-disable-system-debug-messages-in-run-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!