trentm/node-bunyan — pull request #15 by davepacheco (2012-05-11 23:40:45+00:00)
Title: sort output from multiple sources

This change causes bunyan (CLI) to print entries from multiple logs interlaced with each other, sorted by time. This allows you to view multiple log files as a single stream of events, which is really nice for distributed systems. I couldn't think of a case where this *wouldn't* be desirable, but if there's such a case, this behavior could be controlled by an option. (This change doesn't include an option.)

Doing this necessarily requires buffering output from individual log files while waiting for others to be read. This implementation pauses streams to avoid buffering too much data in memory.

There's also a bunch of noise in this change where I fixed some jslint errors in bin/bunyan. Sorry for the noise.

I added a very simple test for this, and also tested this with two relatively large log files (1 32137 lines / 19MB, and 1 34 lines / 12K).