Skip to content

Developer logs not showing up on the debug console anymore while running using the 'Run Without Debugging' option #4875

Closed

Description

@rasitayaz

Describe the bug
Outputs of the log() function from dart:developer import is not showing up at the debug console anymore unless you run the app using "Run > Start Debugging". This was not the case before, I was able to see the logs on my console using "Run > Run Without Debugging" option.

I sometimes need to output long data on my console but this is not seem to be possible using print() since it truncates the text. I also don't want to use debugging mode while developing my application because the app runs too slow and it gets interrupted for every exception.

flutter/flutter#135445

To Reproduce
Steps to reproduce the behavior:

  1. Import dart:developer into your dart code
  2. Log something using log() function
  3. Run the app using "Run > Run Without Debugging"

Expected behavior
Log output to be displayed on debug console.

Please complete the following information:

You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (F1) to easily capture this information or provide it manually.

  • Operating System and version: macOS Sonoma 14.1.2
  • VS Code version: 1.84.2
  • Dart extension version: v3.78.0
  • Dart/Flutter SDK version: 3.16.2
  • Target device (if the issue relates to Flutter debugging): iOS Simulator, macOS, Android Emulator, Web

Activity

  1. DanTup commented on Dec 4, 2023

    @DanTup
    Member

    Thanks for the details - This is currently expected behaviour. Running with "Run" does not connect to the VM Service so functionality that requires a VM Service connection is not available. This was always the case for Dart, but the legacy debug adapters did used to connect the debugger even in noDebug mode.

    I've opened #4876 to document and review the specifics here. It may be that "connecting the VM Service" is not the best place to draw this line between Run/Debug, but we should review (and document) exactly which functionality should be affected by this.

    I also don't want to use debugging mode while developing my application because the app runs too slow and it gets interrupted for every exception.

    You can choose whether or not the debugger breaks on exceptions here:

    image

    If you untick those options, it will not pause on exceptions. I'm unsure what kind of performance difference you're seeing, but if it's caused by connecting the VM Service then they may appear in Run mode if we connect the debugger. If you can provide some more concrete details on the performance difference you see, we can figure out whether it's caused by something in the debug connection.

    I'll close this as a dupe of #4876 because I think any changes should come out of that rather than just reverting this change.

  2. added this to the v3.78.1 milestone on Dec 6, 2023
  3. reopened this on Dec 6, 2023
  4. added
    in flutterRelates to running Flutter apps
    in debuggingRelates to the debug adapter or process of running debug sessions
    and removed on Dec 6, 2023
  5. modified the milestone: v3.78.1 on Dec 6, 2023
  6. DanTup commented on Dec 6, 2023

    @DanTup
    Member

    Since this issue (and a related issue with Widget Inspector navigation #4878) came up a few times, we've decided to apply a patch that resolves this by making the "Start without Debugging" option work more like "Start with Debugging" (that is, it will always connect to the VM Service).

    The fix is already included in the pre-release version of the extension and I'll push later this week or early next week if nothing comes up.

    If you want to try it out, you can switch to the pre-release versions with these button in VS Code:

    Dart/Flutter pre-release versions

  7. DanTup commented on Dec 11, 2023

    @DanTup
    Member

    This issue is resolved in v3.78.2 of the Dart extension. Please update and click the "Reload" button if prompted.

    image

    image

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 debuggingRelates to the debug adapter or process of running debug sessionsin flutterRelates to running Flutter appsis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions