logginator
Advanced tools
Comparing version 1.0.0 to 1.1.0
14
index.js
@@ -0,1 +1,2 @@ | ||
var path = require('path'); | ||
var winston = require('winston'); | ||
@@ -5,2 +6,12 @@ var TaggedConsoleTarget = require('tagged-console-target'); | ||
function moduleName() { | ||
if (module && module.parent && module.parent.id) { | ||
var moduleFile = path.basename(module.parent.id); | ||
var nameMatch = /(.*)\.js$/.exec(moduleFile); | ||
if (nameMatch && nameMatch[1]) | ||
return nameMatch[1]; | ||
} | ||
return "main"; | ||
} | ||
module.exports = function () { | ||
@@ -10,3 +21,4 @@ var winstonLogger = new (winston.Logger)({ transports: [ new TaggedConsoleTarget() ] }); | ||
return log; | ||
var tag = moduleName(); | ||
return log.createSublogger(tag); | ||
}; |
{ | ||
"name": "logginator", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Creates an instance of TaggedLogger", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
1239
19