💾 Archived View for tilde.cafe › ~stack › gemlog › 2023-06-26.tailf.gmi captured on 2024-08-31 at 13:07:01. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-07-22)
-=-=-=-=-=-=-
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.
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.