node-bunyan-lite/examples/ringbuffer.js
2013-03-28 17:42:32 -07:00

14 lines
381 B
JavaScript

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