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

colorize lines in logs differently depending on importance #2152

Open
miguelbarao opened this issue Apr 8, 2022 · 2 comments
Open

colorize lines in logs differently depending on importance #2152

miguelbarao opened this issue Apr 8, 2022 · 2 comments
Labels

Comments

@miguelbarao
Copy link

Thanks for the work you put into bat.
I was considering using tail -f and bat to colorize the log of a running program.
In many logs there are keywords indicating the importance of a line. For example INFO, WARNING, ERROR, CRITICAL, DEBUG.
It would be useful to have the lines colored differently so that errors could be easily spotted.
Would you be interested in supporting this feature?

@miguelbarao miguelbarao added the feature-request New feature or request label Apr 8, 2022
@keith-hall
Copy link
Collaborator

Thanks for the feedback. We had a short discussion on this at #1605 (comment), but it should be possible to cater for both styles - log level word vs full line - with some color scheme customization if we tweak the log syntax to support it.

@MahdiNazemi
Copy link

MahdiNazemi commented Nov 29, 2022

Vim has a very nice syntax highlighting plugin with the following rules:
https://github.com/MTDL9/vim-log-highlighting/blob/master/syntax/log.vim

Is it possible to integrate similar rules in bat?

Here is how my log looks when I use bat:
Screenshot 2022-11-29 at 10 18 14 AM

And here are the same lines of log in Vim:
Screenshot 2022-11-29 at 10 18 47 AM

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

No branches or pull requests

3 participants