Dart Code
Dart & Flutter support for Visual Studio Code

Enabling Logging

The simplest way to capture logs is using the Dart: Capture Logs command, however there are also user settings to allow capturing detailed logs for an individual component over a longer period.

Capture Logs Command

When you’re ready to reproduce your issue, run the Dart: Capture Logs in the command palette.

You’ll be prompted to select a location/filename for the log file and then a notification will appear informing you that logs are being captured.

When you click Stop Logging the resulting log file will be opened in the editor for you to review before you attach to a GitHub issue. Please review the logs for any sensitive data (it may include parts of your files) before sharing.

Individual Logs

Inidividual log files can be enabled by setting the corresponding VS Code Settings.

General Extension Logging

The dart.extensionLogFile setting enables a low-traffic log file for basic extension and editor issues.

To capture an extension log file please do the following:

  1. Set dart.extensionLogFile to a file path, for example /Users/dantup/Desktop/extension.txt
  2. Restart VS Code
  3. Reproduce the issue
  4. Take a copy of the log file
  5. Review the log and remove any sensitive data
  6. Attach the log to a GH issue or if you don’t wish to post it publicly email it to logs@dartcode.org including a link to the related GH issue

Analysis Server Instrumentation Logging

The dart.analyzerInstrumentationLogFile setting enables very detailed logging in the analysis server that may be useful when trying to diagnose analysis server issues.

To capture an analysis server instrumentation log file please do the following:

  1. Set dart.analyzerInstrumentationLogFile to a file path, for example /Users/dantup/Desktop/analyzerInstrumentation.txt
  2. Reproduce the issue
  3. Take a copy of the log file
  4. Review the log and remove any sensitive data
  5. Attach the log to a GH issue or if you don’t wish to post it publicly email it to logs@dartcode.org including a link to the related GH issue

Analysis Server Logging

The dart.analyzerLogFile setting enables logging of communication between Dart Code and the analysis server. Messages are truncated after a few thousand characters but this is useful to when trying to understand how Dart Code is interacting with the analysis server.

To capture an analysis server log file please do the following:

  1. Set dart.analyzerLogFile to a file path, for example /Users/dantup/Desktop/analyzer.txt
  2. Reproduce the issue
  3. Take a copy of the log file
  4. Review the log and remove any sensitive data
  5. Attach the log to a GH issue or if you don’t wish to post it publicly email it to logs@dartcode.org including a link to the related GH issue

Flutter Daemon Logging

The dart.flutterDaemonLogFile setting enables logging of the flutter daemon communication which is the service that provides information about connected devices that is used in the status bar.

To capture a flutter daemon log file please do the following:

  1. Set dart.flutterDaemonLogFile to a file path, for example /Users/dantup/Desktop/flutterDaemon.txt
  2. Reproduce the issue
  3. Take a copy of the log file
  4. Review the log and remove any sensitive data
  5. Attach the log to a GH issue or if you don’t wish to post it publicly email it to logs@dartcode.org including a link to the related GH issue

Flutter Run Logging

The dart.flutterRunLogFile setting enables logging of flutter run which is used to launch Flutter applications from VS Code. This is useful when trying to diagnose issues with applications launching (or failing to) on simulators and devices.

To capture a flutter run log file please do the following:

  1. Set dart.flutterRunLogFile to a file path, for example /Users/dantup/Desktop/flutterRun.txt
  2. Press F5 to run/debug the application
  3. Reproduce the issue
  4. Take a copy of the log file
  5. Review the log and remove any sensitive data
  6. Attach the log to a GH issue or if you don’t wish to post it publicly email it to logs@dartcode.org including a link to the related GH issue

Flutter Test Logging

The dart.flutterTestLogFile setting enables logging of flutter test which is used to run unit tests from VS Code. This is useful when trying to diagnose issues with unit test executions.

To capture a flutter test log file please do the following:

  1. Set dart.flutterTestLogFile to a file path, for example /Users/dantup/Desktop/flutterTest.txt
  2. Open the file containing your tests
  3. Press F5 to run/debug the tests
  4. Wait for the run to complete
  5. Take a copy of the log file
  6. Review the log and remove any sensitive data
  7. Attach the log to a GH issue or if you don’t wish to post it publicly email it to logs@dartcode.org including a link to the related GH issue

Dart Test Logging

The dart.pubTestLogFile setting enables logging of Dart test runs. This is useful when trying to diagnose issues with unit test executions.

To capture a Dart test log file please do the following:

  1. Set dart.pubTestLogFile to a file path, for example /Users/dantup/Desktop/pubTest.txt
  2. Open the file containing your tests
  3. Press F5 to run/debug the tests
  4. Wait for the run to complete
  5. Take a copy of the log file
  6. Review the log and remove any sensitive data
  7. Attach the log to a GH issue or if you don’t wish to post it publicly email it to logs@dartcode.org including a link to the related GH issue

Observatory (Debugger) Logging

The dart.observatoryLogFile setting enables logging of communication between Dart Code and Observatory (the VM debugger). This is useful when trying to diagnose issues with debugging such as missed breakpoints.

To capture an observatory log file please do the following:

  1. Set dart.observatoryLogFile to a file path, for example /Users/dantup/Desktop/observatory.txt
  2. Press F5 to start debugging and reproduce your issue (for example, run the code that misses the breakpoint)
  3. Stop debugging
  4. Take a copy of the log file
  5. Review the log and remove any sensitive data
  6. Attach the log to a GH issue or if you don’t wish to post it publicly email it to logs@dartcode.org including a link to the related GH issue
Fork me on GitHub