Giter Site home page Giter Site logo

good-bugsnag's Introduction

good-bugsnag NPM version Dependency Status Build Status

A good reporter implementation to write hapi server events to the Bugsnag. You'll need a bugsnag account and API key to use this plugin.

Table of Contents generated with DocToc

Install

npm i -S good-bugsnag

Usage

import good from 'good'

const reporters = [
  {
    bugsnag: [{
      module: 'good-bugsnag'
      , args: [
          {
            // add events to pass to good-squeeze subscription
            // https://github.com/hapijs/good-squeeze#squeezesubscriptionevents
          },
          {
            // bugsnag options
            apiKey: 'xxxxx'
          }
        ]
    }]
  }
]

await server.register({
    register: good
  , options: {reporters}
})

Methods

goodBugsnag(<Object> events, <Object> config)

Creates a new GoodBugsnag object with the following arguments:

  • events: an object of key value pairs.

    • key: one of the supported good events. Events, will send their data to Bugsnag.

    • value: a single string or an array of strings to filter incoming events. "*" indicates no filtering. null and undefined are assumed to be "*".

    • defaults:

      {
        log: 'error'
      , error: '*'
      , request: 'error'
      }
  • [config]: configuration object with the following available keys

    • apiKey: required your bugsnag API key.
    • autoNotify: defaults to false: Allows Hapi to report uncaught exceptions and send them via Good, rather than Bugsnag handling them on it's own. You probably want to leave this as the default.
    • any valid Bugsnag configuration option

Tests

Tests are in tape.

  • npm test will run the tests
  • npm run tdd will run the tests on every file change.

Developing

To publish, run npm run release -- [{patch,minor,major}]

NOTE: you might need to sudo ln -s /usr/local/bin/node /usr/bin/node to ensure node is in your path for the git hooks to work

Requirements

  • npm > 2.0.0 So that passing args to a npm script will work. npm i -g npm
  • git > 1.8.3 So that git push --follow-tags will work. brew install git

License

Artistic 2.0 © Joey Baker and contributors. A copy of the license can be found in the file LICENSE.

good-bugsnag's People

Contributors

joeybaker avatar

Stargazers

 avatar

Watchers

 avatar

good-bugsnag's Issues

Good v7

Do you have an example of the setup with good v7?

Typo in README

First line of readme after the title.
ou'll --> you'll

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.