Bunyan CLI - Tail mode

1,087 views
Skip to first unread message

Timothy Quinn

unread,
Feb 10, 2014, 1:44:34 AM2/10/14
to bunyan-...@googlegroups.com
Would it be much to add log file follow functionality to the bunyan CLI script like tail -f?

Eg: %bunyan -f ...

BTW, Kudos on this this tool set. Slick API and very well thought out :)

Timothy Quinn

unread,
Feb 10, 2014, 1:45:54 AM2/10/14
to bunyan-...@googlegroups.com
Correcting subject. Sorry for spam.

Trent Mick

unread,
Feb 13, 2014, 12:08:10 PM2/13/14
to Timothy Quinn, bunyan-...@googlegroups.com
Timothy,

I've wanted that for a while but haven't had a chance to look at implementing it. My limited understanding is that node's fs.watch can be quite finicky or even unreliable so I'm not sure if it'll be simple to implement. Patches for this would definitely be welcome. 

For now I've gotten quite quick at typing 'tail -f logfile | bunyan'

--Trent

Timothy Quinn

unread,
Feb 17, 2014, 1:17:15 PM2/17/14
to Trent Mick, bunyan-...@googlegroups.com
Hi Trent,

Piping on Windohs does not work from my tests. I use gnutools tail and tried cygwin also and both don't work. Unfortunately, my current project demands Windohs support.

I have started a fork of your project on Github and am building tail -n and tail -f functionality. Its in the early stages right now but it seems to be working. I had to add some hard fstat calls to get around issues in windows with fs.watch not being dependable in some of my test cases. With my design, I am using both fs.watch and fs.stat hard call. I'll review a way to add the fs.stat hard calls as an configurable option.

My fork is here: https://github.com/JavaScriptDude/node-bunyan/trunk/bin/bunyan

Please take the code with a grain of salt as I still have quite a bit of cleanup work to do.

Cheers,
- Tim
Reply all
Reply to author
Forward
0 new messages