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

debug-logger

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debug-logger - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

examples/index.js

35

debug-logger.js

@@ -5,4 +5,5 @@ 'use strict';

var vmDebug = require('debug');
exports = module.exports = logger;
exports = module.exports = debugLogger;
var DEBUG_NAMESPACE = ':debug';
var RED = '\x1b[31m';

@@ -47,3 +48,3 @@ var GREEN = '\x1b[32m';

if (e.stack) {
errorStrings[1] = '\n stack trace: ' + e.stack;
errorStrings[1] = 'Stack trace:\n' + e.stack;
}

@@ -55,24 +56,20 @@ return errorStrings;

}
errorStrings[1] = '\n object: ' + util.inspect(e);
errorStrings[1] = 'Inspected object:\n' + util.inspect(e);
return errorStrings;
};
function getFormattedMessage(message, e) {
var errorStrings = getErrorMessage(e);
return message + errorStrings[0] + errorStrings[1];
function getPadding(size){
return new Array(size).join(' ');
}
function logger(namespace) {
function debugLogger(namespace) {
var log = vmDebug(namespace);
var debug = vmDebug(namespace + ':debug');
var debug = vmDebug(namespace + DEBUG_NAMESPACE);
var defaultPadding = '\n' + getPadding(namespace.length + DEBUG_NAMESPACE.length + 11);
var loggerObj = {
var logger = {
logger : log,
debugLogger : debug,
isEnabled : function() {
return log.enabled;
},
isDebugEnabled : function() {
return debug.enabled;
}
isEnabled : log.enabled,
isDebugEnabled : debug.enabled
};

@@ -86,8 +83,10 @@

loggerObj[level] = function(message, e) {
levelLog(color + levels[level].prefix + reset + getFormattedMessage(message, e));
logger[level] = function(message, e) {
var errorStrings = getErrorMessage(e);
var padding = errorStrings[1] != '' ? defaultPadding : '';
levelLog(color + levels[level].prefix + reset + message + errorStrings[0] + padding + errorStrings[1]);
};
});
return loggerObj;
return logger;
};
{
"name": "debug-logger",
"version": "0.1.0",
"version": "0.1.1",
"description": "A wrapper for visionmedia's debug logger",

@@ -5,0 +5,0 @@ "main": "debug-logger.js",

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