Giter Club home page Giter Club logo

deadorbit's Introduction

DeadOrbit

Members of Dead Orbit intend to escape the dying Earth before The Darkness returns, as they've given up on The Traveler and put little faith in The City's ability to hold out against a major attack.

Dead Orbit is a flexible JavaScript utility to log errors in NodeJS and the browser.

Usage

An instance of DeadOrbit is configured with a driver that accepts a standardized error information object and communicates with a logging service, and optionally a processor that can modify or reject the error.

var DeadOrbit = require('deadorbit');
var SentryDriver = require('deadorbit/drivers/sentry');
var BrowserProcessor = require('deadorbit/processors/browserEnv');

var sentryDriver = new SentryDriver({
  server: 'https://sentry.example.com/',
  project: '25',
  key: 'abcde12345'
});
var browserProcessor = new BrowserProcessor();
var deadOrbit = new DeadOrbit(sentryDriver, browserProcessor);

See the drivers directory for more information about the available drivers and the parameters they accept. Likewise, see the processors directory for information about processors.

Errors can be reported by passing an Error instance to the "report" method.

deadOrbit.report(new Error('Test error message'));

The report method also accepts an optional "options" parameter, which can contain the following keys:

  • tags
  • user

Standardized Error Info

A standardized error info object is created by core Dead Orbit code, and is passed to the "process" and "report" methods of processors and drivers.

The standardized error information object can contain the following keys:

  • message The Error's message
  • type The Error's type
  • stacks An array of frame objects
  • user A user object
  • tags An array of custom tags
  • environment An object containing information about the current environment.

A frame object can contain the following keys:

  • fileName The filename for this frame.
  • functionName The function name for this frame.
  • lineNumber The line number for this frame.
  • columnNumber The columne number for this frame.
  • args An array of arguments give to the function of this frame.

Known Issues

  • Drivers have a hard dependency on network communication dependencies. These should be injectable as well. (Milestone: 2.0.0)
  • Sentry driver has poor backwards compatiblity due to the network communication dependency. (Milestone: 2.0.0)
  • Airbrake driver is not yet written. (Milestone: 1.1.0)
  • Project isn't called "dinklebot".

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.