remote-logger
v0.0.1
Published
Send notifications messages to every web-socket connected client
Downloads
4
Readme
Remote-Logger
Remote-Logger is a tiny library for logging error and info on ours nodejs aplications, its use DEBUG
library for logging into console and socketIO
for send those logs message thrown web socket to others users.
Install
npm install [email protected]:BlaShadow/Remote-Logger.git
How to use
if you're using Socket.io on your project just initialize the library with the instance of io
.
var io = ..
var log = require('Remote-Logger')(io);
With express
Like any socketIO
app
var app = require('express').createServer();
var log = require('Remote-Logger')(app);
log.info("Hello world");
log.error("it's failling dude!!!");
log.fatal('this is bad!!',{ some:"data" });
How to use on client side
Its just like include socket.io
library and listen to 3
mayor events that the library its emiting.
- log
- connection (from socket.io)
- disconnect (from socket.io)
and those events too
- log-info
- log-error
- log-debug
- log-faltal