💾 Archived View for gemini.ctrl-c.club › ~stack › gemlog › 2023-06-26.tailf.gmi captured on 2023-07-10 at 13:49:47. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

hottail -- tail -f with a heat-map

I am a big fan of log files. As I develop and test, and deploy code, logs provide invaluable information for debugging and improving (and sometimes, understanding) the system.

While watching logs with 'tail -f' works pretty well, I would _really_ like to see a heat-mapped view of a log. By that I mean colorized lines which start hot and slowly cool -- allowing me to instantly see if anything happened recently, as well as the relative age of entries -- at a glance!

I assumed that anything I can think someone has already done -- the world is now big enough for that. But it appears that no one has, in this case. There are many ways to colorize a log based on its content, but not time-based.

If you know of something like that, please email stack@ctrl-c.club.

Maybe I'll do it myself?

My crocodile brain started coding before I even finished the first search... It's an interesting problem (as I get older I find all problems interesting)... There are some curious edge cases that can really screw you:

So I could read the tail -n- bytes into a buffer and scan backwards for line ends, entering them into an index (along with a timestamp). Later, if a change is detected (say, filesize changed), I can re-read, and scan again, but in a more complicated way, against the old index:

A redisplay task should assign colors based on age, and reprint the required lines. This should be configurable...

Configuration: parameters (ugh), mapping strategy, adjusting time and color at runtime, etc.

Maybe worth a few days of coding, since I have nothing better to do. I want to say a day, but I know better.

index

home

gemini://bbs.geminispace.org/u/stack