bunyanesque

0.2.1 • Public • Published

bunyanesque.js

bunyan logger with a few tweaks

Current status

NPM version Build Status Dependency Status Dev dependency Status Coverage Status

Usage

A small modification of the bunyan logging library.

The differences are:

Plain log() method

log() is an alias for log.info().

var log = require('bunyanesque').createLogger();
 
// These are equivalent:
log('Message');
log.info('Message');

Arguments order

log(message, object) is allowable.

// These are equivalent:
log.info('Message', {a: 123});
log.info({a: 123}, 'Message');

Errors

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.

Other features

All other bunyan features, aside from .child() are not supported.

Tests

Use npm test to run the tests. Use npm run cover to check coverage.

Changelog

See changelog.md

Issues

If you discover a bug, please raise an issue on Github. https://github.com/overlookmotel/bunyanesque/issues

Contribution

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

Package Sidebar

Install

npm i bunyanesque

Weekly Downloads

28

Version

0.2.1

License

none

Last publish

Collaborators

  • overlookmotel