You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
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!
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:
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!
Activity
DanTup commentedon 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:
Alternatively, you can add
--verboseyourself to theargsproperty inlaunch.json. If you don't already have alaunch.jsonyou 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 commentedon 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).
wanjm commentedon 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 commentedon Jun 2, 2020
argsis 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.jsonthat will run a Flutter app (fromlib/main.dart) in verbose mode:DanTup commentedon Jun 2, 2020
Oh, I see the tooltip for
argsis not very clear, because it was written before Flutter apps were supported - I'll update that to be clearer too - thanks!Tweak the description for "args" in launch.json