Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Feature Request: Syntax highlighting #14

Open
jdrews opened this issue Oct 20, 2015 · 5 comments
Open

Feature Request: Syntax highlighting #14

jdrews opened this issue Oct 20, 2015 · 5 comments

Comments

@jdrews
Copy link

jdrews commented Oct 20, 2015

Syntax highlighting would be a welcome feature add. Something that lets a user color logs based on search words or regex. I would expect this to be a parameter or configuration file.

For example highlight all lines that say ERROR with red, DEBUG with blue, INFO with green, etc.

@gvalkov
Copy link
Owner

gvalkov commented Oct 20, 2015

That would be nice indeed (rtail seems to handle that nicely). One option I've been thinking about is to define the highlighting rules in terms of a highlight.js language definition. I'll look into it.

@jdrews
Copy link
Author

jdrews commented Oct 24, 2015

I looked into building a highlight.js language file to colorize logs I often tail. It was actually more complicated than I thought, since highlight.js is geared towards programming language syntax highlighting.

Here's the current syntax highlighter I use in bash environments to make it easier to read logs. It uses sed with regular expressions to add ANSI color tags to lines based on log level keywords.

https://gist.github.com/jdrews/af970bb97e8d34978621

And a picture of the output you get from it:
screenshot_102415_052147_pm

Ideally, whatever you go with I'd hope it would support some sort of regular expression schema to allow users to tie matches to colors.

To give an example: I'd want to color lines that contain "ERROR" red and lines that contain "WARN" yellow so it's easy to tell we have problems.

@jdrews jdrews changed the title Syntax highlighting Feature Request: Syntax highlighting Oct 28, 2015
@efernandez
Copy link

Would it be possible to color using bash control sequences?

http://misc.flogisoft.com/bash/tip_colors_and_formatting

@chines
Copy link

chines commented Mar 5, 2017

Content/Syntax highliting would be a desired feature for me as well. +1 to this, thanks again for such an amazing tool.

InformatiQ pushed a commit to InformatiQ/tailon that referenced this issue Jan 24, 2018
accept either a path or an app name from the frontend
@vizcay
Copy link

vizcay commented Apr 10, 2018

To have at least bash color sequences (that are common in log files) will be a great addon.. integrating something like https://github.com/theZiz/aha maybe? Unfortunately I'm not myself a python dev to submit a PR..

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

No branches or pull requests

5 participants