Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
simple-logs
Advanced tools
Readme
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 = require('simple-logs');
var log = new Log('module_name');
//now we have our methods:
//log.info()
//log.warn()
//log.error()
//log.debug()
npm install simple-logs
var Log = require('simple-logs');
//Every logging method will try to emit an event, you can listen to them as follow.
Log.on('error', function ErrorEvent(log) {
//Do something
});
// Setting debug to false, will make log.debug print or emit no events!
Log.setDebug(true); //Defaults to true
var Log = require('simple-logs');
var log = new Log('SomeModule');
log.info('this is %s', 'running');
log.warn('failed to log action');
log.error('failed to %s', 'write to buffer');
log.debug('his name was %s', 'john');
//I dont recommend doing this, but you can :)
Log.info('this is %s', 'running');
Log.warn('failed to log action');
Log.error('failed to %s', 'write to buffer');
Log.debug('his name was %s', 'john');
If you want to send any contributions, just send me a pull request.
FAQs
A simple method for console logging with colors and in an organized manner.
The npm package simple-logs receives a total of 7 weekly downloads. As such, simple-logs popularity was classified as not popular.
We found that simple-logs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.