Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 46 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,61 @@
# Notification Logger [![npm version](https://badge.fury.io/js/notification-logger.svg)](https://badge.fury.io/js/notification-logger)
# Notification Logger 🔔 [![npm version](https://badge.fury.io/js/notification-logger.svg)](https://badge.fury.io/js/notification-logger)

Ever wondered why you have to open the console every time you want to want to log a variable?
Effortlessly see your `console.log()` messages as **Desktop Notifications** without opening the console. Simplify development and debugging with just ~50 lines added to your project.

Notification Logger helps provide desktop notification for your console messages.
[**Demo**](http://singhharkirat.com/notification-logger) | [**GitHub**](https://github.com/hkirat/notification-logger/)

During development, You have to check the browser's inspector periodically to see what your console.log()'s are saying.
---

With [notification-logger](https://github.com/hkirat/notification-logger/), you can develop and debug web apps and see console messages as Desktop Notifications.
## ⚡ Features

And it only adds ~50 lines to your project.
- Desktop notifications for `console.log()` messages.
- Lightweight, only ~50 lines of code.
- Seamless integration with your existing console methods.

[Demo](http://singhharkirat.com/notification-logger)
---

Initial repo forked from [chinchang](https://github.com/chinchang)'s project [screenlog.js](https://github.com/chinchang/screenlog.js).
Check out his awesomeness over [here](https://kushagragour.in/)
## 📦 Installation

## Screenshot
Install via `npm` or clone the repo:

![notification-logger](./images/image.png)
```bash
npm install notification-logger
```
Or:
```bash
git clone https://github.com/hkirat/notification-logger.git
```

## Installing
- Use `npm` or `git clone` to download the module.
- `npm install notification-logger`
- `git clone https://github.com/hkirat/notification-logger.git`
- include `notification-logger.js` or `notification-logger.min.js`
- Initialise with `logger.init()`
Include `notification-logger.js` or `notification-logger.min.js` and initialize:

## Methods
-----
* `logger.init` - Initialises the logger
* `logger.log` - Logs the message via a Desktop Notification only
* `console.log` - Logs the message via a Desktop Notification and in the browser console
* `logger.destroy` - Reverts console.log to original functionality
```js
logger.init();
```

## Browser Support
---

Works best on latest versions of Google Chrome, Firefox and Safari.
## 🛠️ API Methods

## To Do
- Add Custom Icon to Notifications
- Unwrap Objects while Logging them as Desktop Notification
- **`logger.init()`**: Initialize the logger.
- **`logger.log()`**: Log via desktop notification only.
- **`console.log()`**: Log to both desktop notification and console.
- **`logger.destroy()`**: Restore default console behavior.

## Credits
- Icons Made by [http://www.flaticon.com/authors/roundicons](roundicons).
---

## 🌐 Browser Support

Optimized for the latest versions of **Chrome**, **Firefox**, and **Safari**.

---

## 📝 To-Do

- Add custom icons to notifications.
- Unwrap objects in desktop notifications.

---

## 🎨 Credits

Icons by [Roundicons](http://www.flaticon.com/authors/roundicons).