node-bunyan-lite/test/log-some-loop.js
Trent Mick 778d0f7049 Fix bunyan -p ... (i.e. DTrace integration) on node 4.x and 5.x
This never worked with node >0.x because of faulty logic determining
`nodeSpawnSupportsStdio` -- attempting to compare with, e.g.,
`Number('v1')`.

Fixes #370
2016-03-16 22:32:52 -07:00

15 lines
426 B
JavaScript

// A helper script to log a few times, pause, repeat. We attempt to NOT emit
// to stdout or stderr because this is used for dtrace testing
// and we don't want to mix output.
var bunyan = require('../lib/bunyan');
var log = bunyan.createLogger({
name: 'play',
serializers: bunyan.stdSerializers
});
setInterval(function logSome() {
log.debug({foo: 'bar'}, 'hi at debug')
log.trace('hi at trace')
}, 1000);