mirror of
https://github.com/mthenw/frontail.git
synced 2026-04-26 10:15:52 +03:00
[GH-ISSUE #34] feature request: allow colouring lines based on tags #20
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/frontail#20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pmlopes on GitHub (Aug 27, 2014).
Original GitHub issue: https://github.com/mthenw/frontail/issues/34
For example I can tail some log file and look for a specific token "ERROR" which i would like to be shown as red, and DEBUG: which would be say green...
It would be nice to have some extra function before sending the line to grep for a tag/word and apply a colour to the whole line.
@mthenw commented on GitHub (Sep 3, 2014):
Hi,
currently I'm on vacation. Will answer in next week.
@keithics commented on GitHub (Sep 11, 2014):
+1
@orbitbot commented on GitHub (Oct 1, 2014):
I made a somewhat hacky implementation of the request while familiarizing myself with the codebase, the diff is here:
github.com/orbitbot/frontail@4d658ed940The change enables a new command line option
--highlights <path to config.json>, that allows you to selectively apply CSS rules to a string or entire line matching a value in the JSON config. A sample file would have a structure like... where the
wordssection will apply the CSS to the matched string itself, and thelineswill apply the CSS rule to the whole line. N.B. that the string matching is case sensitive in my quick implementation.Start frontail f.e. like this
node-dev index.js /var/log/syslog -p 3001 -t dark --ui-no-indent --highlights highlights.json— if using thelinesparameter there are some CSS rules about line indentation that cancel each other (?) but still makes the line background offset, unless the--ui-no-indentoption is given.@mthenw commented on GitHub (Oct 1, 2014):
@orbitbot that's super cool. I was thinking about similar thing. Could you create pull request for that? Or maybe I could use some parts of your diff to create it by myself?
@orbitbot commented on GitHub (Oct 2, 2014):
@mthenw I just made a pull request with the supplied diff, do as you please :) I was thinking about having a go at cleaning it up and handling some other cases, testing and documentation, but there's no guarantee that I'll have any time for that within a reasonable time.
Just out of curiosity, what is the reasoning behind the
margin-left: 84pt; text-indent: -84pt;for the
.inner-lineCSS class? I doesn't seem to be meaningful with or without the command line option using the default CSS.@mthenw commented on GitHub (Oct 2, 2014):
@orbitbot AFAIR it's used while marking line to get red background filling whole line.
@mthenw commented on GitHub (Oct 6, 2014):
@pmlopes @keithics I've added new options --ui-highlight (https://github.com/mthenw/frontail#highlighting). Please provide your opinion about this.
Currently it's only in master, not published as new version to NPM.