简体   繁体   中英

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:

Bunyan格式的调试控制台

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

在此处输入图片说明

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM