GithubHelp home page GithubHelp logo

logger-facade-airbrake-plugin-nodejs's Introduction

Build Status Code Climate Coverage Dependency Status Grunt

Logger Facade Airbrake plugin for Nodejs

version

Simple node module to log errors on Airbrake using logger facade.

This simple logger facade allows pluggin hook to execute different logging.

How to use it

Install it:

npm install logger-facade-nodejs
npm install logger-facade-airbrake-plugin

Set up plugins and log errors

var Logger = require('logger-facade-nodejs');
var LoggerAirbrakePlugin = require('logger-facade-airbrake-plugin');

console.log("Start sample of Async error Log...");

var config = {
  //api key, default (null)
  apiKey: "apikey",
  // host, default (null)
  host: "api.airbrake.io",
  // port, default (80)
  port: 80,
  // protocol, default (http)
  protocol: 'http',
  // notify uncaught excpetions, default (false)
  notifyUncaughtException: false,
  // dev envs, default (['development', 'test'])
  developmentEnvironments: ['development', 'test'],
  // appVersion, default (null)
  appVersion: null
};

var plugin = new LoggerAirbrakePlugin(config);
Logger.use(plugin);

console.log("Plugins: ", Logger.plugins());

var log = Logger.getLogger("Name");
log.error("Message to log %s", 'with args');

console.log("End sample...");

Download the code from this gist.

Contribution

Bug fixes and new features are of course very welcome!

To get started developing:

  • Install Grunt
  • Install dependencies with npm install
  • Run the test suite with npm test

Please accompany any Pull Requests with the relevant test cases and make sure everything else still passes :).

Contribution Flow

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Bump versioning

We use grunt bump package to control package versioning.

Bump Patch version

$ grunt bump

Bump Minor version

$ grunt bump:minor

Bump Major version

$ grunt bump:major

Running Specs

$ npm test

Coverage Report

We aim for 100% coverage and we hope it keeps that way! :) We use pre-commit and pre-push hooks and CI to accomplish this, so don't mess with our build! :P

Check the report after running npm test.

$ open ./coverage/lcov-report/index.html

Credits

Shout out to @pjanuario.

logger-facade-airbrake-plugin-nodejs's People

Contributors

pjanuario avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.