A small modification of the bunyan logging library.
The differences are:
log()
is an alias for log.info()
.
var log = require('bunyanesque').createLogger();
// These are equivalent:
log('Message');
log.info('Message');
log(message, object)
is allowable.
// These are equivalent:
log.info('Message', {a: 123});
log.info({a: 123}, 'Message');
Errors can be passed directly (log( new Error('It went pear-shaped') )
) rather than under an err
attribute (log( { err: new Error('It went pear-shaped') } )
).
Errors (instances of the Error
constructor) are automatically moved to under an err
attribute. So they can then be rendered nicely by bunyan's standard serializer.
All other bunyan
features, aside from .child()
are not supported.
Use npm test
to run the tests. Use npm run cover
to check coverage.
See changelog.md
If you discover a bug, please raise an issue on Github. https://github.com/overlookmotel/bunyanesque/issues
Pull requests are very welcome. Please:
- ensure all tests pass before submitting PR
- add an entry to changelog
- add tests for new features
- document new functionality/API additions in README