Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign custom highlighting patterns to predefined log items #168

Open
bobatsar opened this issue Nov 30, 2020 · 4 comments
Open

Assign custom highlighting patterns to predefined log items #168

bobatsar opened this issue Nov 30, 2020 · 4 comments

Comments

@bobatsar
Copy link

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"
    },
]
@emilast
Copy link
Owner

emilast commented Dec 6, 2020

No, I'm afraid not. Nice idea, but with the current implementation I think it would be hard to implement.

@mianowill
Copy link

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 :)

@emilast
Copy link
Owner

emilast commented Nov 15, 2023

@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.

@mianowill
Copy link

@emilast totally forgot about this. Will do, ty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants