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

Please help start a revolution in CLI log viewing #5

Open
Ralithune opened this issue Jun 25, 2024 · 0 comments
Open

Please help start a revolution in CLI log viewing #5

Ralithune opened this issue Jun 25, 2024 · 0 comments

Comments

@Ralithune
Copy link

Describe the solution you'd like
Everyone uses vim. Being an SRE in my early 40s, I am younger than many of the people who've been fighting the emacs / vim battle and using linux / unix systems since I was in diapers, but I do understand vaguely the history and context I'm bucking when I ask for this feature in vim.

I would love it if vim had native support for ANSI color escape sequences.

If vim could display the colors with a toggleable option, ignore them during searches, and provide a viewing option that simply removes them from display, we could all finally start writing color logs.

Describe alternatives you've considered
I've seen posted on SO links to a vim script / add-on that displays ansi color from the escape sequences, but this is an install barrier that will never get done when peers go to view logs. Most people I work with are very familiar with vim, but they've never modded it or tried to edit things beyond setting a .vimrc. I can't ask them to look at my logs and before that also follow this 7-step install process that requires them to think.

Additional context
But, why? Vim is for editing, not viewing! Blasphemer! Use less!

  • I personally, and most of my peers at my fortune 100 company, use vim for log and text file viewing because we're familiar with it. There's simply no need to run less / more because vim fulfills the all the things we need - moving up and down in the file, searching for specific strings, viewing line end characters and line numbers. We know how to do those thing and because we write in vim all the time for quick little shiv-scripts, it's second nature.

A "revolution"? That's a bit dramatic don't you think?

  • I write CLI utilities a lot. I also use color a lot to communicate information to the user - identify something that needs their attention, something that went well (green) something to warn them about (yellow), or just picking random different colors to display lines that are happening with different contexts / targets simultaneously while threads / processes run and report their results.
  • The logs my utilities write are always stripped of ansi color escape sequences - partially for log searching, but mostly because it looks ugly when it's opened in vim and it's hard to read.
  • If vim had a toggleable option for displaying color sequences by default, I could send color-enabled logs (or have my users send them to me) and finally have some eye relief when reading thousands of lines of text.
  • Because vim is the go-to, the default, having native support means that I don't need to ask my engineering peers to go to a website and fiddle with installing something on their system before they can read my log.
  • As I'm sure many of you know, the TRULY best code security is to put it behind an install / environment altering wall. :)

Convenience is king, but especially in software dev.

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

No branches or pull requests

1 participant