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

Support terminal escape codes for colors #14

Open
deseven opened this issue Mar 29, 2019 · 2 comments
Open

Support terminal escape codes for colors #14

deseven opened this issue Mar 29, 2019 · 2 comments

Comments

@deseven
Copy link

deseven commented Mar 29, 2019

There are some escape sequences for terminals, usually used for color output. Many loggers love to use them.

As an example:
�[31msome text�[39m

As a bare minimum, if you don't want to make color support, it would be nice to at least know about it and strip them from text completely.

@paladine
Copy link

+1 to this. I wouldn't mind doing this myself as I have a fully functional ANSI parser in both C/Java, but I'd have to port to go and web frontend development isn't my forte. If somebody could point me in the right direction, I'd be happy to contribute.

@NickWaterton
Copy link

I just implemented this in the Python version of tailon.
I’m using a rewritten version of grc (grcat) to insert ANSI codes, and ansi2html to convert to inline html.

The only slight issue is in the logfile.js file, you have to remove the escapeHtml filter, otherwise the inline html prints as plain text instead of being rendered. This also means that any inline html you try to view will also be rendered. I haven’t had too much problem with this, as most log files don’t have inline html in them.

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

No branches or pull requests

3 participants