Skip to content

how to add --verbose in vscode #2514

Closed
Closed

Description

@wanjm

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;

Activity

  1. DanTup commented on Jun 1, 2020

    @DanTup
    Member

    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!

  2. added
    in docs / websiteRelates to documentation, including the Dart Code website
    on Jun 1, 2020
  3. DanTup commented on Jun 1, 2020

    @DanTup
    Member

    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).

  4. added this to the v3.12.0 milestone on Jun 1, 2020
  5. wanjm commented on Jun 2, 2020

    @wanjm
    Author

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

  6. DanTup commented on Jun 2, 2020

    @DanTup
    Member

    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"
    	]
    }
  7. DanTup commented on Jun 2, 2020

    @DanTup
    Member

    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!

  8. modified the milestones: v3.12.0, On Deck on Jun 17, 2020
  9. modified the milestones: On Deck, v3.13.0 on Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in docs / websiteRelates to documentation, including the Dart Code website

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions