node-bunyan-lite/examples/ringbuffer.js
2012-06-19 14:44:50 -07:00

11 lines
291 B
JavaScript

/* Create a ring buffer that stores the last 100 entries. */
var bunyan = require('..');
var ringbuffer = new bunyan.RingBuffer({ limit: 100 });
var log = new bunyan({
name: 'foo',
stream: ringbuffer,
level: 'debug'
});
log.info('hello world');
console.log(ringbuffer.entries);