Skip to content

Problem with colors when parameters contain object #172868

@svallory

Description

@svallory

Describe the bug
Logged messages with colors and objects do not display correctly on Debug Console. Messages without objects display correctly.

To Reproduce

import Debugger from 'debug';
const debug = Debugger('cva:init');
debug('Initializing');
debug({ a: 4 });

Log File

Relevant launch configuration

{
      "name": "Attach to Figma",
      "type": "chrome",
      "request": "attach",
      "address": "localhost",
      "port": 9222,
      "targetSelection": "pick",
      "pauseForSourceMap": true,
      "pathMapping": {
        "/file/": "${workspaceRoot}/",
        "../src/": "${workspaceRoot}/src/",
        "src/": "${workspaceRoot}/src/"
      },
      "outFiles": [
        "${workspaceFolder}/build/*.js",
        "${workspaceFolder}/build/*.js.map",
      ],
      "presentation": {
        "hidden": false,
        "group": "Figma",
        "order": 2,
      },
      "internalConsoleOptions": "openOnSessionStart"
    }

VS Code Version: 1.74.2

Additional context

NOTE: I added BEFORE FORMAT and AFTER FORMAT to the debug library to check what it was doing

image

EDIT

An easier way to reproduce. Type this directly on the debug console:

console.log('%cThis %cWorks %c +1ms', 'color: #00CC00', 'color: inherit', 'color: #00CC00');
console.log('%cThis %cDOES NOT %c +1ms %o', 'color: #00CC00', 'color: inherit', 'color: #00CC00', []);

image

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugdebugDebug viewlet, configurations, breakpoints, adapter issuesverifiedVerification succeeded

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions