Track your bugs easy!
HeartBeat.js is a small (8Kb minified), zero-dependency library for sending console events to user-defined URL. It supports all major console events (log, warn, etc.) and errors.
bower install heartbeat
npm install heartbeat.js
Minimal example:
var options = {
url: 'http://example.com/logger'
};
heartbeat.start(options);
id
- user identifier
timestamp
- event timestamp
data.message
- message (or error) text
data.url
- page URL
data.line
- message (or error) line number
data.col
- message (or error) column number
event
- event name
useragent
- browser user agent
{
"id":1375674124,
"timestamp":1439691618654,
"data":{
"message":"test",
"url":"http://example.com",
"line":"6",
"col":"13"
},
"event":"console.log",
"useragent":"Mozilla/5.0 Chrome/40.0.2403.155 Safari/537.36"
}
Type:String
URL where to send log information;
Type:Array
Default: ["log", "info", "warn", "error", "assert", "dir", "clear", "profile", "profileEnd"]
Console methods to monitor.
Type:Boolean
Default: true
Enable console monitoring
Type:Boolean
Default: true
Enable error monitoring
Type:Function
Default: function(){}
Callback function
Please submit a pull request, if your company is using it
MIT, see LICENSE file