49

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.

3
  • See the Answer in this issue: stackoverflow.com/questions/51268169/… Commented Mar 31, 2019 at 9:57
  • 3
    Thanks, but I can't see any relationship between my question and the answer provided by you. The question is also different. Mine is: How to DISABLE system debug messages in Android Studio. The one provided by you is: How to SEARCH the Debug Console in Visual Studio Code. As you can see, 'DISABLE' vs 'SEARCH', 'Android Studio' vs 'Visual Studio Code', completely different IDE and question. To clarify, my problem is not searching, but the too many useless system debug messages (sometimes more than a thousand in a minute! Depending on the plugins I added in pubspec). Commented Mar 31, 2019 at 11:18
  • 1
    For example, I want to check the program flow, so I added print('01'), print('02'), print('03') ......etc in some lines of my codes. I want to see 01, 02, 03 in the Run Tab. Unfortunately, flutter is giving me '01', ..... [One hundred other debug messages]....., '02', .....[more than 300 debug messages]......'03'..... [probably followed by another few hundreds of debug messages, shown by flutter, dart, plugins whatever]. Commented Mar 31, 2019 at 11:25

8 Answers 8

68

In Android Studio....

Before

enter image description here

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. enter image description here For example in Flutter, I'd remove D/ (i.e. letter D + forward slash) which are emulator debug messages.

After

enter image description here


Sign up to request clarification or add additional context in comments.

2 Comments

Still working as of 2022. (Android Studio 211.7628, Flutter 2.10.4)
@baker You will never believe how much this helped me. Thanks.
25

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 .

Vscode debug console filtering for flutter

that's it !

Before :

enter image description here

After:

enter image description here

4 Comments

Thanks for this. Helped me to cleanup the dreaded debug console.
I could not copy specific lines when using the filter. Is there any workaround for this?
I just tried it with the latest Vs code + latest flutter and I can copy .... can you update and try again ? + waht is the line you cannot copy ?
how u guys run in "Debug Console" and not "Terminal" ??, mine is always start my flutter command in "Terminal" tab and all logs are printing in "Terminal" tab too... I'm so confused
13

In Android Studio:

Comments

8

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

setting

Now you can filter as follows

filter

5 Comments

What about VS Code?
@RobertWilliams console filter here is provided by jetbrains ide or android studio. AFAIK vscode provides logging in web browser only and maybe without filtering.
You are right but what should i do to get clean logs in vs code or atleast in terminal?
@RobertWilliams github.com/microsoft/vscode/issues/50093. I'm not sure if VS Code is likely to get the ability to add filters though, I think it still aims to be a lightweight editor rather than a big IDE with all features. Look for extensions that allow you to filter logs in vscode.
I can't find that option, did they remove it?
5

The android-studio 4.0 has a setting to make this messages go away. Go to File -> Settings -> Languages and Frameworks -> Flutter Uncheck the box stating Enable verbose logging

Settings View

Comments

5

Add

I/flutter

in filter of VsCode Debug Console Filter. enter image description here

Comments

3

Alternative: Use Flutter Dev Tools

The Flutter Dev Tools show logs in a less verbose way:

Screenshot: Flutter Dev Tools

In Android Studio

Open the Flutter Dev Tools by clicking on the little Dart icon in the console of Android Studio.

Screenshot: Open Flutter Dev Tools and verbose logging

Comments

0

Debug(Alt+5) -> Layout Settings -> check variable and console see image below: enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.