vscode-logfile-highlighter icon indicating copy to clipboard operation
vscode-logfile-highlighter copied to clipboard

Add option to highlight whole line

Open nermin99 opened this issue 1 year ago • 1 comments

For example, I might want to highlight the whole line where an error occurred so it's easier to find when scrolling

nermin99 avatar Jan 19 '24 20:01 nermin99

That would be really helpful and cut down on the extra patterns you need to add but if you add:

"logFileHighlighter.customPatterns": [ { "pattern": "(ERROR .*)", "foreground": "#af1f1f", "background": "#030303" },

to your settings that will highlight the whole line starting with ERROR

kingmi140 avatar Mar 14 '24 02:03 kingmi140

I agree with @kingmi140, this can easily be solved with a pattern like ".*ERROR.*". Or do you mean you want to highlight the row past the end of the line content, to the edge of the window? There is unfortunately no easy way to accomplish that AFAIK, since we can only decorate characters in the editor window, not the whitespace surrounding them.

emilast avatar Jun 19 '24 19:06 emilast

@emilast Okay yeah ".*ERROR.*" did the job and was what I was aiming for. I know we can use this pattern but wouldn't it be very nice and convenient to also make it a setting? I really believe that it is a commonly used feature among log-file highlighting tools like e.g. BaretailPro. I would never have guessed that I could use this pattern without this github thread...

Also ".*ERROR.*" is case sensitive so then I would have to add another pattern to cover the lower case version ".*error.*".

Really appreciate the work you do!

nermin99 avatar Jun 19 '24 20:06 nermin99

In version 3.2.0, there is now a new setting for custom patterns: highlightEntireLine I hope this helps.

emilast avatar Jun 30 '24 16:06 emilast

@emilast Thanks! och bra jobbat ;)

nermin99 avatar Jun 30 '24 17:06 nermin99