Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hf-node-logger

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hf-node-logger - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

test.js

50

logger.js

@@ -0,4 +1,6 @@

var colors = require('colors');
module.exports = function(options){
var DEBUG = 'debug'
var DEBUG = 'debug';
var INFO = 'info';

@@ -22,2 +24,18 @@ var WARNING = 'warning';

var colors = function(level){
DEBUG = DEBUG.blue;
INFO = INFO.cyan;
WARNING = WARNING.yellow;
SEVERE = SEVERE.magenta;
CRITICAL = CRITICAL.red;
methods.critical = function(message){
log(CRITICAL, message.red);
};
if (level !== CRITICAL){
methods.severe = function(message){
log(SEVERE, message.magenta);
};
}
};
stdOut = options.stdOut || console.log;

@@ -28,15 +46,2 @@ errOut = options.errOut || console.error;

var log = function(level, message){
var timestamp = new Date();
message = timestamp+' | '+name+' | '+level+' | '+message;
if(level === INFO || level === WARNING){
stdOut(message);
}else if(level === SEVERE || level === CRITICAL){
errOut(message);
}else{
errOut('loglevel is not supported for:\n'+message);
}
}
if (level !== CRITICAL){

@@ -63,4 +68,21 @@ methods.severe = function(message){

options.colors && colors(level);
var log = function(level, message){
var timestamp = new Date();
message = timestamp+' | '+name+' | '+level+' | '+message;
if(level === DEBUG || level === INFO || level === WARNING){
stdOut(message);
}else if(level === SEVERE || level === CRITICAL){
errOut(message);
}else{
errOut('loglevel is not supported for:\n'+message);
}
}
return methods;
}
{
"name": "hf-node-logger",
"version": "1.1.3",
"version": "1.2.0",
"description": "A logger module with loglevels",

@@ -23,3 +23,6 @@ "main": "logger.js",

},
"homepage": "https://github.com/HitFox/hf-node-logger#readme"
"homepage": "https://github.com/HitFox/hf-node-logger#readme",
"dependencies": {
"colors": "^1.1.2"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc