Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/i-break-codes/logerr
Make JavaScript errors readable, and log them remotely.
https://github.com/i-break-codes/logerr
Last synced: 19 days ago
JSON representation
Make JavaScript errors readable, and log them remotely.
- Host: GitHub
- URL: https://github.com/i-break-codes/logerr
- Owner: i-break-codes
- License: mit
- Created: 2016-06-28T13:16:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-10T20:58:16.000Z (over 7 years ago)
- Last Synced: 2024-02-17T14:31:12.550Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 67.4 KB
- Stars: 397
- Watchers: 15
- Forks: 26
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![alt tag](http://i.imgur.com/rVWDzcC.png)
[![CDNJS](https://img.shields.io/cdnjs/v/logerr.svg)](https://cdnjs.com/libraries/logerr)
Logerr or Log Error. Playing with console errors, experimental project. Started developing for Chrome but now it supports Internet Explorer as well as Edge.
#### Online Demo
[View](https://i-break-codes.github.io/logerr/) (Don't forget to open your dev console)---
#### What does it do?
Provides JavaScript error details in a readable format. You can log these errors remotely by enabling `remoteLogging`. After enabling, logerr will send a post request to the desired action/url with exception details along with custom parameters (if provided using `additionalParams`).---
#### Install:
#### CDN
**Development [Unminified]**
> https://cdnjs.cloudflare.com/ajax/libs/logerr/1.2.0/logerr.js**Production [Minified]**
> https://cdnjs.cloudflare.com/ajax/libs/logerr/1.2.0/logerr.min.js#### [npm](http://npmjs.com)
```bash
npm install i-break-codes/logerr
```#### [Bower](https://bower.io/)
```bash
bower install logerr
```#### Manually
Download `logerr.js` and follow the setup instructions below.
---
#### Setup
Just include `logerr.js` file and the `init()` i.e initializer in the `` section of your page, before you include any other JavaScript. `init()` will initialize the lib, where later you can pass an object to customize.```html
Logerr.init();
Am fancy
```
---
#### Enable remote logging
> Make sure you have CORS enabled if logging cross-domain.```javascript
//Request type is POSTLogerr.init({
remoteLogging: true, //Checkout https://github.com/i-break-codes/logerr-remote
remoteSettings: {
url: 'REMOTE_URL',
additionalParams: {
logged_by: 'Sam'
},
successCallback: function () {
console.log('Im logged.');
},
errorCallback: function () {
console.log('Err! Something went wrong.');
}
}
});
```Also checkout Logerr Remote to log these exceptions remotely. (Powered by NodeJS)
[View](https://github.com/i-break-codes/logerr-remote)
---
#### Default Configuration & Datatypes
```javascript
detailedErrors: true //Boolean true/false, optional
remoteLogging: false //Boolean true/false, optional
remoteSettings: { //Object {}, required if remoteLogging is set to true
url: null, //String '', required if remoteLogging is set to true
additionalParams: null, //Object {}, optional
successCallback: null, //function() {}, optional
errorCallback: null //function() {}, optional
}```
---
#### Roadmap
- [x] Enable/Disable detailedErrors mode in console.
- [x] Remote logging by sending post request
- [x] Cross browser support (Partially fixed)
- [ ] Add notifications on the page if any exception. (in progress)...will add some more stuff to make debugging easy.
---
#### Support
- Bugs and requests, submit them through the project's issues section
- Questions? DM or Tweet me [@mr_ali3n](https://twitter.com/mr_ali3n)Thanks to all contributors, stargazers, pr's, issue submissions for suggesting features and making this more awesome.