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

how to add --verbose in vscode #2514

Closed
wanjm opened this issue Jun 1, 2020 · 5 comments
Closed

how to add --verbose in vscode #2514

wanjm opened this issue Jun 1, 2020 · 5 comments
Labels
in docs / website Relates to documentation, including the Dart Code website
Milestone

Comments

@wanjm
Copy link

wanjm commented Jun 1, 2020

I am run flutter in vscode, but it throws a exception;
when report error in flutter, they ask to run "flutter run --verbose". but this commands works with no exception;

then how can i add --verbose in vscode for flutter to get more logs;

@DanTup
Copy link
Member

DanTup commented Jun 1, 2020

The simplest way is to use the Dart: Capture Logs command in VS Code. This will automatically run Flutter in verbose mode while capturing:

  • Run Dart: Capture Logs
  • Tick only Flutter Run and Debugger options and click OK
  • Start the debug session and reproduce your issue
  • Click Cancel on the logging notification, which will stop logging and open the log file

Alternatively, you can add --verbose yourself to the args property in launch.json. If you don't already have a launch.json you can run the Debug: Open launch.json command in VS Code, and use the Flutter template to create one.

Let me know if you have any issues or questions with this!

@DanTup DanTup added the in docs / website Relates to documentation, including the Dart Code website label Jun 1, 2020
@DanTup
Copy link
Member

DanTup commented Jun 1, 2020

I'll keep this open as a note to make this easier to find if searching online (might also be worth noting on https://flutter.dev/docs/resources/bug-reports).

@DanTup DanTup added this to the v3.12.0 milestone Jun 1, 2020
@wanjm
Copy link
Author

wanjm commented Jun 2, 2020

"args" is used for "Command line arguments to the application", I thought i was for the application I have written instead of flutter;

@DanTup
Copy link
Member

DanTup commented Jun 2, 2020

args is used to pass arguments to the application being run. For a Dart project, this is your script, so the args are passed to your script. For a Flutter project, it's the Flutter tool, so the args are passed to that.

Here's an example of a launch.json that will run a Flutter app (from lib/main.dart) in verbose mode:

{
	"name": "Flutter",
	"type": "dart",
	"request": "launch",
	"program": "lib/main.dart",
	"args": [
		"--verbose"
	]
}

@DanTup
Copy link
Member

DanTup commented Jun 2, 2020

Oh, I see the tooltip for args is not very clear, because it was written before Flutter apps were supported - I'll update that to be clearer too - thanks!

DanTup added a commit that referenced this issue Jun 2, 2020
@DanTup DanTup modified the milestones: v3.12.0, On Deck Jun 17, 2020
@DanTup DanTup modified the milestones: On Deck, v3.13.0 Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in docs / website Relates to documentation, including the Dart Code website
Projects
None yet
Development

No branches or pull requests

2 participants