Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add a flag to flutter run & flutter logs to filter output #50808

Open
christopherfujino opened this issue Feb 14, 2020 · 27 comments
Labels
good first issue Relatively approachable for first-time contributors P3 Issues that are less important to the Flutter project platform-android Android applications specifically team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-android Triaged by Android platform team

Comments

@christopherfujino
Copy link
Member

After #45743, we stopped filtering log output (by the string flutter both because it broke benchmark tasks and because it obscured when the app crashed. The downside is that the logs are much noisier. This should be configurable by a flag.

For more context, see: #50628

@FozanKh

This comment has been minimized.

@jmagman

This comment has been minimized.

@christopherfujino christopherfujino changed the title Add a flag to flutter run & flutter logs to filter output Feature request: Add a flag to flutter run & flutter logs to filter output Apr 6, 2020
@peterkapena
Copy link

): setVertexArrayObject: set vao to 0 (0) 1 2
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 1 (1) 1 6
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 0 (0) 1 2
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 1 (1) 1 6
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 0 (0) 1 2
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 1 (1) 1 6
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 0 (0) 1 2
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 1 (1) 1 6
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 0 (0) 1 2
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 1 (1) 1 6
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 0 (0) 1 2
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 1 (1) 1 6
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 0 (0) 1 2
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 1 (1) 1 6
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 0 (0) 1 2
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 1 (1) 1 6
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 0 (0) 1 2
D/eglCodecCommon(19578): setVertexArrayObject: set vao to 1 (1) 1 6

Hot to remove these?

@madhavtripathi05
Copy link

Easy Fix (if you're using VSCode):
Inside Debug Console you can apply Filters
e.g. For excluding something you can type !pattern
in your case !D/egl..

@WebSheldon
Copy link

we can use the plugin 'Grep Console' on Intellij IDEA to filter the console logs.
i

@GanongLS
Copy link

GanongLS commented Feb 8, 2021

Hope this feature release soon, it's so annoying to watch my log so messy.

@jmagman jmagman added the platform-android Android applications specifically label Feb 8, 2021
@AdnanKazi
Copy link

@madhavtripathi05 Can I use multiple filters ?

@madhavtripathi05
Copy link

@madhavtripathi05 Can I use multiple filters ?

yes you can separated by commas

@AdnanKazi
Copy link

Thanks man

@madhavtripathi05 Can I use multiple filters ?

yes you can separated by commas

@Apollo108
Copy link

@madhavtripathi05 I didn't manage to add another filter using comma as a separator, maybe we can configure something here (see acreenshot)? But I don't understand how to do this, I need to filter multiple lines, please, help

image

@william-levi
Copy link

any update on this ?

@s-talkanova-fraiss
Copy link

Any update on when this is going to get implemented? <.<

@dreamflasher
Copy link

Easy Fix (if you're using VSCode):
Inside Debug Console you can apply Filters
e.g. For excluding something you can type !pattern
in your case !D/egl..

This only works in debug console. flutter run is executed in the Terminal tab, which does not support filters. How do you filter in the terminal tab or how do you run this in the debug console?

Really hoping for a fix here, spammy debug messages make the log output unusable.

@insinfo

This comment was marked as duplicate.

1 similar comment
@iamsahilsonawane

This comment was marked as duplicate.

@armeaux

This comment was marked as duplicate.

@blasten
Copy link

blasten commented May 10, 2022

This makes sense. I don't fully remember why I went down this route.
One potential solution is to show verbose logs only when the --verbose flag is passed to the flutter command. Otherwise, default to filtering by tag name and timestamp.

@blasten blasten added the good first issue Relatively approachable for first-time contributors label May 10, 2022
@blasten
Copy link

blasten commented May 10, 2022

If anyone would like to try creating a patch, feel free to send us a PR.

@blasten blasten added waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds P3 Issues that are less important to the Flutter project labels May 10, 2022
@blasten
Copy link

blasten commented May 17, 2022

cc @camsim99

@github-actions
Copy link

github-actions bot commented Jun 2, 2022

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.

@github-actions github-actions bot closed this as completed Jun 2, 2022
@dreamflasher
Copy link

Weird? Everything is clearly described, all the information is there. Looks like this was closed by mistake?
@blasten could you please reopen?

@camsim99 camsim99 reopened this Jun 2, 2022
Tools - command line usability review automation moved this from Engineer reviewed to Awaiting triage Jun 2, 2022
@github-actions
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.

Tools - command line usability review automation moved this from Awaiting triage to Engineer reviewed Jun 17, 2022
@dreamflasher
Copy link

Please reopen the ticket and turn off the bot.

@jmagman jmagman removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 18, 2022
@jmagman jmagman reopened this Jun 18, 2022
Tools - command line usability review automation moved this from Engineer reviewed to Awaiting triage Jun 18, 2022
@kalabro
Copy link

kalabro commented Jun 24, 2022

I've started working on the fix here #106569 (currently struggling with tests)

@kalabro
Copy link

kalabro commented Jun 24, 2022

One potential solution is to show verbose logs only when the --verbose flag is passed to the flutter command. Otherwise, default to filtering by tag name and timestamp.

Hi @blasten, a newcomer here 👋
I added a trivial check for the verbose mode here #106569. Before I go ahead and fix all the tests, could you please confirm my approach?

I can see quite a lot of tests validate the logcat command arguments. I also discovered that some things (#45732) could rely on the current verbose output.

Another potential place for implementing filtering is probably AdbLogReader::_onLine. I can explore it further if it's the way to go

Update: issue #104268 seems to be related

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-android Owned by Android platform team triaged-android Triaged by Android platform team labels Jul 8, 2023
@Nukesor
Copy link

Nukesor commented Aug 6, 2023

For all those of you that don't use a editor with a build-in terminal that supports filtering, but rather depend on the commandline, here's a goodie for you:
your flutter command here | sed '/^\(V\|I\|W\|E\)\/flutter/!d'

This sed command filters all that annoying stuff and is a pretty neat workaround until there's a proper flutter built-in solution :)

@ianselley
Copy link

For all those of you that don't use a editor with a build-in terminal that supports filtering, but rather depend on the commandline, here's a goodie for you: your flutter command here | sed '/^\(V\|I\|W\|E\)\/flutter/!d'

This sed command filters all that annoying stuff and is a pretty neat workaround until there's a proper flutter built-in solution :)

Great approach!

While this works great, I like seeing the first logs while i'm waiting for my flutter app to run. For that I've tweaked your command to:
flutter run | sed '/^.\// { /^\(V\|I\|W\|E\)\/flutter/!d }'

This also prints the lines that don't have a "/" in the second position

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Relatively approachable for first-time contributors P3 Issues that are less important to the Flutter project platform-android Android applications specifically team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-android Triaged by Android platform team
Projects
Development

No branches or pull requests