visual-studio-codebunyan

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.


Solution

  • 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"
            }
        ]
    }