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({
|
2013-03-29 00:42:32 +00:00
|
|
|
name: 'foo',
|
|
|
|
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);
|