In VS Code, how can I filter debug console messages by log level / severity?

46 Views Asked by At

In my debug console view in VS Code, I can see that some messages are blue and some are red (like info vs errors/warnings). I'd like to be able to filter by whatever notion is separating these types of messages. Ex. to only see those that are info messages.

enter image description here

Here's my launch config, if that matters:

{
      "name": "Attach to Chrome",
      "port": 8080,
      "request": "attach",
      "type": "chrome",
      "webRoot": "${workspaceFolder}",
      "outputCapture": "console"
    },
1

There are 1 best solutions below

0
starball On

You can already search by text (see How to search the debug console in vscode?), but I don't think filtering by any sort of notion of log "level" or "severity" is a thing in the debug console view. See issue ticket Support filtering debug console items by level #105864. The Debug Adapter Protocol doesn't have a notion of log levels or severity. It does have a notion of "channels" (it calls them "categories") such as stdout and stderr, so VS Code could technically have a feature to filter by those, but I don't think that exists right now, and that issue ticket got closed as "out of scope", and I don't know whether that's referring to the log level filter idea, or the channel filter idea, or both. You could try raising an issue ticket specifically about the channel filter idea if you're interested in having that.