Do you ever have a terminal watching logs or recompiling on save and you aren't sure if the most recent messages are from the change you just made, or 10 minutes ago? watchlog will help you but adding a message at the bottom of your terminal that haven't produced output recently. After a short period of no output watchlog will start displaying the time since last output below the command.
HTTP/1.1 GET /api/books/1 500 HTTP/1.1 GET /api/books/2 500 HTTP/1.1 GET /api/books/1 500 HTTP/1.1 GET /api/books/1 200 Last output 48s ago.
When the command produces more output it will look like normal if it hasn't been too long, however if it has been a while watchlog will inject a timestamp so that the logs are grouped by when they occurred when you scroll up.
HTTP/1.1 GET /api/books/1 500 HTTP/1.1 GET /api/books/2 500 HTTP/1.1 GET /api/books/1 500 HTTP/1.1 GET /api/books/1 200 2021-03-24 19:39:10 HTTP/1.1 PUT /api/books/1 200 HTTP/1.1 GET /api/books/1 200 HTTP/1.1 GET /api/books/1 304
Simply put | wl
after your command.
sh
$ python -m http.server | wl
sh
$ cargo install watchlog
sh
$ nix-env -i -f . -A watchlog
watchlog is currently very basic. (For example it hardcodes xterm ANSII escapes and values that I find convenient.) However I am happy to answer any questions, discuss features, bugs or possible contributions. Just open an issue (even if you just want to say hello)