Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter disable system debug messages in Run Tab

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.

like image 938
Kenneth Li Avatar asked Mar 31 '19 03:03

Kenneth Li


People also ask

How do I turn off debug on flutter?

To remove the Flutter debug banner, there are several possibilities: The first one is to use the debugShowCheckModeBanner property in your MaterialApp widget. And then do a hot reload. The second possibility is to hide debug mode banner in Flutter Inspector if you use Android Studio or IntelliJ IDEA.

What is flutter verbose?

The flutter run command will run your application on a connected device, or iOS simulator, or Android Emulator. You can also use --verbose command to get a detailed log while running the application.

How do you set break point in flutter?

To set a breakpoint, click the left margin (the line number ruler) in the source area. Clicking once sets a breakpoint, which should also show up in the Breakpoints area on the left. Clicking again removes the breakpoint.


2 Answers

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


like image 87
Baker Avatar answered Sep 19 '22 18:09

Baker


In Android Studio:

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

    Android Studio Flutter Console folding

like image 37
Gelderson Alves Avatar answered Sep 18 '22 18:09

Gelderson Alves