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

Highlight terminal output based on regex pattern #9965

Closed
Agaspher20 opened this issue Apr 27, 2021 · 5 comments
Closed

Highlight terminal output based on regex pattern #9965

Agaspher20 opened this issue Apr 27, 2021 · 5 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@Agaspher20
Copy link

Agaspher20 commented Apr 27, 2021

Description of the new feature/enhancement

That would be really handy to have an ability to apply some custom highlighting to terminal output.
For example when I read logs generated by some application I want to highlight particular feature name I'm interested in. So if logs of this feature start with Info: [Feature name] log message, I want to highlight "[Feature name]" with yellow.

That should be an ability to specify various highlighting rules. E.g. I have the following outputs
error: [feature 1] error message here
warning: [feature 2] some another message
info: [feature 3] yet another message

In this case I want to highlight "error:" with red, "warning:" with yellow, "info with green and "debug" with blue. And of course that would be cool if I highlight different features with different colors.

Just to emphasize. That is not mandatory that patterns are at the beginning of the string. It could be in any part of the string.

Proposed technical implementation details

A set of rules in settings.json which associate regex pattern with color. E.g.:

{
    "highlightRules": [
        "pattern": "^error:",
        "color": "red"
    ], [
        "pattern": "\[feature name\]",
        "color": "#deab1f"
    ], [
        "pattern" "^(?:\d{2,4}-?)+\s(?:\d{2,3}[:\.]?)+", // date pattern
        "color": "#34ebe1"
    ]
}
@Agaspher20 Agaspher20 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Apr 27, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Apr 27, 2021
@skyline75489
Copy link
Collaborator

Similar request: #7561

@skyline75489
Copy link
Collaborator

#7561 and #3920 both focus on highlighting search result. Do people really want to highlight output (of certain pattern) all the time ? I don't know. I feel colored output is good enough for me personally.

@Agaspher20
Copy link
Author

#7561 and #3920 both focus on highlighting search result. Do people really want to highlight output (of certain pattern) all the time ? I don't know. I feel colored output is good enough for me personally.

Yes that would be good to highlight output on regular basis and the difference of this request from #7561 is that you wouldn't have any dialog open when output is highlighted.

That would be also cool if that could look more like code highlighting then search results highlighting.

@zadjii-msft
Copy link
Member

Yea, generally we're tracking this in #3920 and linked threads. I know #8294 mentions "links", but I think a lot of what that's tracking would apply to even not links.

/dup #7561
/dup #3920
/dup #8294

@ghost
Copy link

ghost commented Apr 29, 2021

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants