2012-06-21 21:53:05 +00:00
|
|
|
/* Create a ring buffer that stores the last 100 records. */
|
2012-06-19 21:36:02 +00:00
|
|
|
var bunyan = require('..');
|
|
|
|
var ringbuffer = new bunyan.RingBuffer({ limit: 100 });
|
|
|
|
var log = new bunyan({
|
|
|
|
name: 'foo',
|
2012-06-21 21:49:04 +00:00
|
|
|
streams: [{
|
|
|
|
type: 'raw',
|
|
|
|
stream: ringbuffer,
|
|
|
|
level: 'debug'
|
|
|
|
}]
|
2012-06-19 21:36:02 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
log.info('hello world');
|
2012-06-21 21:53:05 +00:00
|
|
|
console.log(ringbuffer.records);
|