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

nice-simple-logger

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nice-simple-logger - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

test.js

34

index.js

@@ -58,4 +58,10 @@ "use strict";

options = options || {};
options = _.defaults(options || {}, {
logLevel: 255,
logstash: false,
ttyColors: true
});
options.logLevel = process.env.NSL_LEVEL ? parseInt(process.env.NSL_LEVEL) : options.logLevel;
if(options.logstash){

@@ -91,3 +97,3 @@ options.logstash.port = options.logstash.port || 9999;

if(isatty){
if(isatty && options.ttyColors){
level = colored(level, levels[level]);

@@ -112,3 +118,8 @@ ts = colored(ts, 'grey');

/* jshint bitwise: false */
log: function() {
if(!(options.logLevel & 4)){
return;
}
log.apply(null, ['INFO'].concat(Array.prototype.slice.call(arguments)));

@@ -118,8 +129,13 @@ },

debug: function() {
if(options.debug){
log.apply(null, ['DEBUG'].concat(Array.prototype.slice.call(arguments)));
if(!(options.logLevel & 16)){
return;
}
log.apply(null, ['DEBUG'].concat(Array.prototype.slice.call(arguments)));
},
error: function error () {
if(!(options.logLevel & 1)){
return;
}
// capture error() call location

@@ -148,2 +164,5 @@ var stackErr = new Error();

warn: function() {
if(!(options.logLevel & 2)){
return;
}
log.apply(null, ['WARN'].concat(Array.prototype.slice.call(arguments)));

@@ -153,2 +172,5 @@ },

warning: function() {
if(!(options.logLevel & 2)){
return;
}
log.apply(null, ['WARN'].concat(Array.prototype.slice.call(arguments)));

@@ -158,2 +180,6 @@ },

expressLogger: function (options) {
if(!(options.logLevel & 8)){
return;
}
if ('object' == typeof options) {

@@ -160,0 +186,0 @@ options = options || {};

2

package.json

@@ -9,3 +9,3 @@ {

},
"version": "0.0.2",
"version": "0.0.3",
"main": "./index.js",

@@ -12,0 +12,0 @@ "keywords": ["logger", "log"],

Sorry, the diff of this file is not supported yet

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