Skip to content

Colored debug console output is not working #2733

Closed

Description

@acoutts

Terminal appears to be able to color output still:
Screen Shot 2020-08-20 at 7 49 17 AM

But the debug console is not coloring output now:
Screen Shot 2020-08-20 at 6 33 35 AM


Version: 1.48.0-insider
Commit: db40434f562994116e5b21c24015a2e40b2504e6
Date: 2020-08-11T23:14:32.083Z (1 wk ago)
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.6.0
dart-code: 3.13.2
[✓] Flutter (Channel dev, 1.21.0-7.0.pre, on Mac OS X 10.15.6 19G73, locale en-US)
    • Flutter version 1.21.0-7.0.pre at /Users/andrewcoutts/Projects/flutter
    • Framework revision 5a6dfa35ca (2 weeks ago), 2020-08-03 10:33:07 -0700
    • Engine revision 083282e33b
    • Dart version 2.10.0 (build 2.10.0-4.0.dev 365525432a)

Activity

  1. acoutts commented on Aug 20, 2020

    @acoutts
    Author
  2. DanTup commented on Aug 24, 2020

    @DanTup
    Member

    @acoutts do you have steps to reproduce this? I'm seeing coloured text when using the ansicolors package and in the error output:

    Screenshot 2020-08-24 at 13 44 09

    I'm testing with:

    Version: 1.49.0-insider
    Commit: f57a418b019926b38d2e6949265c33002a8f6f6b
    Date: 2020-08-24T08:17:33.759Z
    Electron: 9.2.0
    Chrome: 83.0.4103.122
    Node.js: 12.14.1
    V8: 8.3.110.13-electron.0
    OS: Darwin x64 19.5.0
    
  3. added
    awaiting info
    on Aug 24, 2020
  4. acoutts commented on Aug 24, 2020

    @acoutts
    Author

    Ah you're right - exceptions from the widgets library are coloring correctly for me too. It's the output from the logger library here that's not working for me now: https://pub.dev/packages/logger (v0.9.2, the latest).

    Strange thing is it works fine in VSCode but it's broken in my insiders install on both of my machines.

    Heres where it is working:
    Screen Shot 2020-08-24 at 9 13 10 AM

    VSCode:

    Version: 1.48.1
    Commit: 3dd905126b34dcd4de81fa624eb3a8cbe7485f13
    Date: 2020-08-19T17:09:41.484Z (4 days ago)
    Electron: 7.3.2
    Chrome: 78.0.3904.130
    Node.js: 12.8.1
    V8: 7.8.279.23-electron.0
    OS: Darwin x64 19.6.0
    

    Dart extension:

    3.13.2
    

    And broken in insiders:
    Screen Shot 2020-08-24 at 9 16 14 AM

    Version: 1.49.0-insider
    Commit: f57a418b019926b38d2e6949265c33002a8f6f6b
    Date: 2020-08-24T08:17:33.759Z
    Electron: 9.2.0
    Chrome: 83.0.4103.122
    Node.js: 12.14.1
    V8: 8.3.110.13-electron.0
    OS: Darwin x64 19.6.0
    

    It looks like I have the same dart-code on both the working one and broken one, so it might be something outside of your extension. It was working in insiders until about a week or so ago I'd estimate.

  5. DanTup commented on Aug 24, 2020

    @DanTup
    Member

    @acoutts how are you running the app? In today's insiders, this still works for me:

    Screenshot 2020-08-24 at 15 04 29

    However in your output, you have flutter: prefixes so I'm wondering if you're running differently to me (I'm using F5). If you're using the built-in terminal and just running flutter run, then that output isn't affected by the extension at all (for all intents and purposes, that's just a terminal that's embedded in VS Code - we have no special powers over it and can't mess with its output). In that case, I would raise this i the VS Code repo directly (and post a link back here for anyone else that comes across it). Thanks!

  6. acoutts commented on Aug 24, 2020

    @acoutts
    Author

    That's an interesting point too. I'm using a launch config and pressing the green play button as I often switch between launch configs.

    Here's the one I was using in that screenshot:

        {
          "name": "BOTTLE_DEBUG_DEVICE_1",
          "request": "launch",
          "type": "dart",
          "deviceId": "${env:BOTTLE_DEBUG_DEVICE_1}",
          "args": [
            "--flavor",
            "sandbox"
          ]
        },
    
  7. DanTup commented on Aug 24, 2020

    @DanTup
    Member

    @acoutts Oh wait, I was testing with a plain Dart project, not Flutter 🙈

    I'll try again!

  8. DanTup commented on Aug 24, 2020

    @DanTup
    Member

    Ok, I can repro - but not only in Insiders, but also stable, and also from the terminal:

    danny@Dannys-MBP flutter_sample % flutter --version
    Flutter 1.22.0-2.0.pre.36 • channel master • [email protected]:DanTup/flutter.git
    Framework • revision d30e36ba8c (3 days ago) • 2020-08-21 22:36:03 -0400
    Engine • revision d495da20d0
    Tools • Dart 2.10.0 (build 2.10.0-49.0.dev)
    
    final pen = AnsiPen()..white(bold: true);
    print(pen('Bright white foreground') + ' this text is default fg/bg');
    
    var logger = Logger();
    logger.e('error!');
    logger.w('warn!');
    logger.i('info!');
    danny@Dannys-MBP flutter_sample % flutter run  -d iphone
    Launching lib/main.dart on iPhone SE (2nd generation) in debug mode...
    Running Xcode build...                                                  
     └─Compiling, linking and signing...                         3.4s
    Xcode build done.                                           12.2s
    flutter: \^[[38;5;15mBright white foreground\^[[0m this text is default f<…>
    flutter: \^[[38;5;196m┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
    flutter: \^[[38;5;196m│ #0   MyApp.build (package:flutter_sample/main.dart:17:1<…>
    flutter: \^[[38;5;196m│ #1   StatelessElement.build (package:flutter/src/widgets/framework.dart:4640:2<…>
    flutter: \^[[38;5;196m├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄<…>
    flutter: \^[[38;5;196m│ ⛔ error!<…>
    flutter: \^[[38;5;196m└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
    flutter: \^[[38;5;208m┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
    flutter: \^[[38;5;208m│ #0   MyApp.build (package:flutter_sample/main.dart:18:1<…>
    flutter: \^[[38;5;208m│ #1   StatelessElement.build (package:flutter/src/widgets/framework.dart:4640:2<…>
    flutter: \^[[38;5;208m├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄<…>
    flutter: \^[[38;5;208m│ ⚠️ warn!<…>
    flutter: \^[[38;5;208m└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
    flutter: \^[[38;5;12m┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
    flutter: \^[[38;5;12m│ #0   MyApp.build (package:flutter_sample/main.dart:19:1<…>
    flutter: \^[[38;5;12m│ #1   StatelessElement.build (package:flutter/src/widgets/framework.dart:4640:2<…>
    flutter: \^[[38;5;12m├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄<…>
    flutter: \^[[38;5;12m│ 💡 info!<…>
    flutter: \^[[38;5;12m└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
    Waiting for iPhone SE (2nd generation) to report its views...          3ms
    Syncing files to device iPhone SE (2nd generation)...              106ms
    

    Screenshot 2020-08-24 at 15 27 42

    So I think something may have changed in Flutter - would you mind raising at flutter/flutter? Thanks!

  9. added
    upstream in dart / flutter
    and removed
    awaiting info
    on Aug 24, 2020
  10. changed the title [-]Colored debug console output is not working recently in Insiders[/-] [+]Colored debug console output is not working[/+] on Aug 24, 2020
  11. acoutts commented on Aug 24, 2020

    @acoutts
    Author

    Thanks for looking into it and confirming for me @DanTup

  12. acoutts commented on Aug 24, 2020

    @acoutts
    Author

    Ahh so the issue seems to only be in iOS builds. Definitely sounding more like a flutter issue.

  13. radrt commented on May 14, 2023

    @radrt

    I have the same issue for ios.
    When android, colors are there.

    (Android studio)

  14. DanTup commented on May 15, 2023

    @DanTup
    Member

    The issue needs handling in Flutter - there's an open issue about that at flutter/flutter#64491.

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

    upstream in dart / flutter

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions