Reputation: 6041
This is currently a feature request, so I know the answer isn't straight forward, but I assume some clever people found clever workarounds for this.
One way is to copy/paste the output in some text editor, but ew.
Someone suggested redirecting the debug output to the terminal, which does have a search feature, sounds better.
So, the question is, how does one redirect the debug output to the terminal?
Unless, of course, you have an even better solution.
EDIT (from the GitHub thread)
You can use the property "console": "integratedTerminal" on the debug launch task to redirect the output to the terminal.
Upvotes: 28
Views: 29224
Reputation: 50977
The Debug Console has a filter control since v1.49 which supports filtering things that match or don't match a pattern (prefix with !
to use "exclude" mode). You can focus this control with ctrl/cmd+f when the Debug Console is focused.
It also has a find widget since v1.93 (see also #225093). The control can be focused with ctrl/cmd+alt/opt+f when the Debug Console is focused. In v1.93, the find widget only searches inputs in the Debug Console. I think in 1.94 it will also search outputs (see #225417).
Upvotes: 2
Reputation: 1326616
Since August 2020 and VSCode 1.49, the Debug Console does support filtering:
Debug Console filter
The Debug Console now supports filtering, making it easier for users to find the output they are looking for, or to hide irrelevant logging output.
The filter also supports exclude patterns (for example, patterns starting with an exclamation mark
!
).
The filter only applies to program output, but not to evaluations run by a user.Like other input boxes in VS Code, you can use the up and down arrow keys to navigate between old filter inputs.
In the short video below, the output is filtered to entries that include the text '
http
', do not include the text 'http
' (using the filter!http
), and then include the word 'Severity
':
(Click on the picture to enlarge. Look for the filter at the top right section of the animation)
And with the upcoming Sept. 2020 VSCode 1.50, you know where you are in your search:
Since last milestone the Debug Console supports filtering, making it easier for users to find the output they are looking for, or to hide irrelevant logging output.
Now we have added a badge to make it clear how many items are filtered away.
Nov. 2023, Sattar Hummatli adds in the comments:
Go to root folder of project and type "
flutter logs
"
As noted by Troopers in the comments:
You can combine filters (
AND
) using a comma:!native, !result
Upvotes: 14
Reputation: 1408
To have search instead of filter you need to go to root folder of project and type flutter logs
Upvotes: -1
Reputation: 446
I recently stumbled upon the same issue and managed to find a workaround that did the trick for me. I thought I'd share it here in case it could help you or anyone else who's grappling with the same problem.
Navigate to the Keyboard Shortcuts section in VSCode Code > Settings > Keyboard Shortcuts
.
Use the search bar to look for cmd+f
.
After locating the command, check the When
column, in my case it indicated that Find
should always trigger if editor is open, even if not in focus editorFocus || editorIsOpen
.
To make the command functional even when the terminal is in focus, modify the When
value to editorFocus || editorIsOpen && !terminalFocus
so that it checks if terminal is not in focus when cmd+F pressed.
Upvotes: 1
Reputation: 6041
Looks like this answer is now outdated, see this other answer instead.
A type-to-filter functionality has been added. To use it:
cmd + F
/ ctrl + F
You will see what you type in the upper right corner of the debug console.
You can then "enable filter on type" (the 3 lines left of the 'x') and only matching lines will show in the debug console. Press Escape to clear the search.
So it's not exactly the search feature OP was looking for, plus you can't type spaces, but it's the best built in tool for now (July 2019).
Upvotes: 31