Giter VIP home page Giter VIP logo

ember-cli-bugsnag-reporter's Introduction

ember-cli-bugsnag-reporter

This addon goal is to make it easy the integration of bugsnag to an ember app.

Installation

ember install ember-cli-bugsnag-reporter

Reporting events

By default all ember errors are automatically reported to bugsnag you have nothing to do.

If you need to manually report bugsnag's event you should use the service bugsnag that is exposed by this addon. The service as 4 methods you can use to report events :

error(name: string | Error, metaData?: object)

Report a bugsnag's event with the severity set to error. You can include some extra data to the report with the second param metaData (see the bugsnag's doc).

warning(name: string | Error, metaData?: object)

Report a bugsnag's event with the severity set to warning. You can include some extra data to the report with the second param metaData (see the bugsnag's doc).

info(name: string | Error, metaData?: object)

Report a bugsnag's event with the severity set to info. You can include some extra data to the report with the second param metaData (see the bugsnag's doc).

notify(name: string | Error, options?: object)

For this one have a look to this page.

Configuration

To configure ember-cli-bugsnag-reporter:

Add a POJO in config/environment.js

{
  "bugsnag-reporter": {
    apiKey: "",
    notifyReleaseStages: ["development", "production"]
  }
}

The releaseStage defaults to the current application environment, if you need to set a different releaseStage that diverges from the environment, you can pass and additional attribute to the bugsnag configuration called releaseStage. It would look like this:

{
  "bugsnag-reporter": {
    apiKey: "",
    notifyReleaseStages: ["development", "production", "staging"],
    releaseStage: "staging"
  }
}

The options you can set are listed here.

Customization

In order to send additional data along with errors reported to Bugsnag, generate a utility named bugsnag:

ember g util bugsnag

Both function takes the container as an argument.

Custom Diagnostics (docs)

To send custom meta data, define a helper method getMetaData in the app/utils/bugsnag.js you created. getMetaData takes the error and the container as arguments, e.g.:

export function getMetaData(/* appInstance */) {
  return {
    // …some meta data
  };
}

This method is called for every errors and any data returned by it are included as meta data for the respective error.

return {
  account: {
    name: "Bugsnag",
    plan: "premium",
    beta_access: true
  }
};

Identifying Users (docs)

To correlate a specific user to an error and have the information appear in the User tab in the Bugsnag UI, send user data with each error data. Define a helper method getUser in the app/utils/bugsnag.js you created.

export function getUser(appInstance) {
  const user = appInstance.lookup('service:current-user').getUser();
  return {
    email: user.email,
    id: user.id,
    name: user.name
  };
}

Uploading Sourcemaps (docs)

Uploading sourcemaps to Bugsnag makes it easier to track down errors in your code because the stacktrace for each error in the Bugsnag UI highlights the exact line in your unminified source code. To send sourcemaps Bugsnag, use the Ember CLI Deploy addon ember-cli-deploy-bugsnag.

Contributing


Installation

  • git clone <repository-url>
  • cd ember-cli-bugsnag-reporter
  • npm install

Linting

  • npm run lint:js
  • npm run lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

ember-cli-bugsnag-reporter's People

Contributors

kamikillerto avatar

Watchers

 avatar Ralph Zimmermann avatar James Cloos avatar Dmitry Krasnoukhov 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.