simple-logs
Simple logs is a simple method for logging, its straight foward. See the examples below.
There are 4 methods, log.info, log.warn, log.error and log.debug.
For each module simple-logs will be in, you can instanciate a new Log, and pass in a text to prepend to each log, so in this case:
var Log = ; var log = 'module_name'; //now we have our methods://log.info()//log.warn()//log.error()//log.debug()
Installation
npm install simple-logs
Usage example
- Core.js
var Log = ; //Every logging method will try to emit an event, you can listen to them as follow.Log; // Setting debug to false, will make log.debug print or emit no events!Log; //Defaults to true
- SomeModule.js
var Log = ; var log = 'SomeModule'; log;log;log;log; //I dont recommend doing this, but you can :)Log;Log;Log;Log;
Authors
Contribute
If you want to send any contributions, just send me a pull request.