Readit News logoReadit News
Posted by u/bensadeh 2 years ago
Show HN: Tailspin – A Log File Highlightergithub.com/bensadeh/tails...
There are multiple programs for working with log files, both inside and outside of the terminal. These tools are feature rich and functional and offer lots of control to the user.

However, a lot of the time I found myself just opening raw log files in `less`. I enjoy the simplicity of quickly skimming through the logs, but it was difficult when the wall of text was in one color.

For this reason, I created a command line tool called `tailspin` (the name is a take on the `tail` command) that did one thing: highlighting of log files. It is configurable, but requires no setup. It defaults to opening up a file in `less`, but can also work with stdin and stdout.

mh-cx · 2 years ago
Even if it's obvious: I was missing a "How to use" section in the README that demonstrates how this tool can be invoked.

EDIT: Ok, there's something in the "Working with STDIN and STDOUT" section. But TBH I'd find it more helpful to have the different use cases collected at the top. To me it wasn't even clear how the command is called.

cyberge99 · 2 years ago
I would love to see better performance with triggers. Even on an M1 Pro Max when I have triggers I get a slightly noticeable lag. It could just be me though. I run at 5k resolution with a lot of text.
johnmaguire · 2 years ago
Are triggers a tailspin feature, or are you referring to iTerm triggers which are mentioned elsewhere in this thread?
bensadeh · 2 years ago
Thanks for the feedback! Good idea to showcase the use cases earlier and clearer.
joshka · 2 years ago
This is really pretty - I do really wish for a good rust replacement for lnav[1] someday.

1: https://lnav.org/

tstack · 2 years ago
I also wish for a rust replacement of lnav! (I'm the author)

I actually started working on one earlier this year and made some progress before getting distracted. I was using tui-rs, which then got forked to ratatui. I should check back in with it sometime soon.

joshka · 2 years ago
As it happens, I'm one of the maintainers of Ratatui, so it's been a little bit more than an idle thought... If you do happen to find time to revive the project I'd be happy to help. Come say hi on the ratatui discord / matrix.
hiAndrewQuinn · 2 years ago
Did you run into any huge roadblocks when you were trying to port the C++ codebase? I've really been digging `lnav` for the last few days - it gives me a sizeable fraction of Datadog's power in my tiny new embedded world.
swah · 2 years ago
Another useful trick is iTerm's Triggers - I use those a bit to find specific strings and store in Airtable or highlight in yellow.
joshka · 2 years ago
Yeah - highlighting ERROR as white on red everywhere anywhere is ops gold.
Groxx · 2 years ago
You can set up links too! Handy for noticing Jira task IDs and linking them, or (if you work on a single project) GitHub pull request numbers.
kunley · 2 years ago
"it requires no configuration or setup", still every single example comes with a config file. WTF?

If you look at it more closely, it can be seen that there is no configuration needed for pattern discovery, but there is for colors. Still, it all together looks a bit dumb. I mean, it's pretty un-marketing to claim something and in the following section do the opposite, even if for a different reason.

I believe this unfortunate working can be fixed.

johnmaguire · 2 years ago
This looks really cool! I interact with log files on the command line often. I usually end up using less unless I need better search / highlighting, at which point I bust open vim.

This looks like a great alternative. There was no Homebrew package so I installed Cargo in order to compile it.

Unfortunately, the first log file I tested it on (admittedly quite large at 868M) took 2 minutes and 45 seconds to open in tailspin, pegging a core the entire time. This same file opens instantly with less.

RandomBK · 2 years ago
Probably not as efficient, but I've been happily using grc [0] for the past several years. It handles simple rules quite well - beyond the basic info/debug/error coloring I use it for QOL such as different colors for even/odd timestamps and highlighting decimal places in large numbers.

[0] https://github.com/garabik/grc

miller_joe · 2 years ago
Looks great. Another tool in this space is https://github.com/humanlogio/humanlog
drcongo · 2 years ago
`apt install tailspin` gives me `Unable to locate package tailspin` - Ubuntu 22.04
michaelmcdonald · 2 years ago
Same for me - Debian 10
arp242 · 2 years ago
First release is from July this year, so not surprising older Ubuntu and (even older) Debian doesn't have a package.

Anyhow: https://repology.org/project/tailspin/versions

bensadeh · 2 years ago
Sorry about that! The debian packages are a bit outside my control, but `cargo install tailspin` should do the trick. I might need to remove it from the readme if people aren't able to install that way.