vscode-logfile-highlighter
vscode-logfile-highlighter copied to clipboard
Assign custom highlighting patterns to predefined log items
Is there a way to use the custom highlighting patterns and attach them to the predefined log items?
e.g.:
"logFileHighlighter.customPatterns": [
{
"pattern": "E/\\w+",
"scope": "log.error"
},
{
"pattern": "Q/\\w+",
"scope": "log.warning"
},
]
No, I'm afraid not. Nice idea, but with the current implementation I think it would be hard to implement.
Just chiming in to say I'd also love if this were possible in the future! I currently have custom patterns for ESP32 log highlighting but this only works with certain themes.
"logFileHighlighter.customPatterns": [
{
// comments (//)
"pattern": "[^:]//.*",
"foreground": "#a0abbd"
},
{
// info
"pattern": "^I [()0-9.:]+",
"foreground": "#13a10e"
},
{
// warning
"pattern": "^W [()0-9.:]+",
"foreground": "#c19c00"
},
{
// error
"pattern": "^E [()0-9.:]+",
"foreground": "#c50f1f"
},
{
// debug or verbose
"pattern": "^[DV] [()0-9.:]+",
"foreground": "#8c8be0"
},
],
Ideally I would be able to replace the hex codes with something like terminal.ansiGreen
etc. to grab a suitably readable colour that matches the theme.
If that's still difficult to implement would you consider adding (or allowing a PR with) specific support for ESP32 style logs @emilast? I'll open a separate issue if you're interested :)
@mianowill, I'm going though old issues and just saw your comment which I apparently missed before. Sorry for that. Please create a separate issue for the ESP32 log file style and supply an example and I'll see what I can do, if that would still be useful for you.
@emilast totally forgot about this. Will do, ty!