Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode Debug console customization

I've a project that i'm using Bunyan logger as logger agent. But the Bunyan logs with the json format the debug texts, and this make difficult to read the output:

Debug console with Bunyan format

But Bunyan provides a CLI tool to humanize the log that converts the JSON to a readable text:

enter image description here

What I want's is create an extension to enable Bunyan console format to the Debug output text, automatic transforming the json output to debug text. But in VSCode extension development API I couldn't find any reference to manipulate debug console. I if can manipulate de Debug console message, I could return te messages well formatted as Bunyan format. So my question is if have some documentation to manipulate debug console messages or how i can work with debug console messages in my vscode extension.

like image 705
alvaropaco Avatar asked Jan 18 '17 14:01

alvaropaco


People also ask

How do I change debug configuration in VS Code?

Alternatively, you can run your configuration through the Command Palette (Ctrl+Shift+P) by filtering on Debug: Select and Start Debugging or typing 'debug ' and selecting the configuration you want to debug. In addition, the debug status appears in the Status Bar showing the active debug configuration.

How do I change debug config in Visual Studio?

In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).


1 Answers

I have found the answer by myself. I can do this simply changing my Debugger configurations, setting args and console type as the follow:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceRoot}/app.js",
            "cwd": "${workspaceRoot}",
            "args": [
                "|",
                "bunyan"
            ],
            "console": "integratedTerminal"
        }
    ]
}
like image 141
alvaropaco Avatar answered Sep 30 '22 14:09

alvaropaco