Bugflux reporting library
Still under development, subscribe at project homepage to be up to date.
Installation and basic usage
Install package by running npm install bugflux --save
.
By default all uncaught exceptions are sent to bugflux server, the only thing you have to do is to set the default configuration:
var bugflux = ; bugflux; console; // <-- Print "Your project name"throw ; // <-- Report will be sent here
You can disable it by setting bugflux.options.sendUncaughtExceptions
to false
.
Options
All global settings can be found at bugflux.options.*
:
silent
- Disable priting error message to standard error stream when uncaught exception occurs (defaultfalse
);sendUncaughtExceptions
- Enable automatic error reporting when uncaught exception occurs (defaulttrue
).strictSSL
- Force to use https protocol and verified certificates (defaulttrue
, we do not recommend changing this value, but you can use it for testing or developing purposes).
Reporting manually
You can send reports manually by calling send
method:
var bugflux = ; ;
The send
method accept bugflux.report
, raw Object
or Error
:
// 1. bugflux.reportvar report = ;// - or -var report = project: 'Custom project name';// - or -var report = project: 'Awesome project name' ; report; // <-- Fill error details (hash, name, stack_trace) bugflux;
// 2. Objectbugflux;
// 3. Errorbugflux;
Server response
The send
method accept callback as a second argument. The callback parameters are forwarded from request method.
var bugflux = ; bugflux;