pb4now
pb4now

Reputation: 1155

Reduce console output for Flutter in android studio

In most of the tutorials on YouTube, the output shown in console is mostly the output made by user itself (by that I mean output created by calling print() - my console is a mess though)

enter image description here

Is there a way to reduce the output only to things I call print() on in Android studio?

Upvotes: 4

Views: 1885

Answers (2)

King Alawaka
King Alawaka

Reputation: 529

You can use Dart Dev tools and set up a filter to get only the print statements Next to the hot restart, you can find the button get Dart Dev tools In Dart dev tools go to the logging tab and create a filter k:stdout

Upvotes: -1

CopsOnRoad
CopsOnRoad

Reputation: 268504

As of now, there is no way of showing logs which are only from print() statement. However there is a workaround.

Whenever you write something in print statement, you can add some prefix to it like instead of writing it as

print('This is my log message');  // earlier way

You can write it as

print('myTag: This is my log message');  // newer way

After that all you need to do is use the search box functionality

enter image description here


Note: You can also create live template for print so that myTag is automatically added to it.

Upvotes: 9

Related Questions