node-bunyan-lite/examples/ringbuffer.js

13 lines
306 B
JavaScript
Raw Normal View History

2012-06-19 21:36:02 +00:00
/* 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',
2012-06-20 23:26:28 +00:00
raw: true,
2012-06-19 21:36:02 +00:00
stream: ringbuffer,
level: 'debug'
});
log.info('hello world');
console.log(ringbuffer.entries);