byteskode-logger
Advanced tools
Comparing version 0.1.0 to 0.1.1
23
index.js
@@ -70,17 +70,18 @@ 'use strict'; | ||
//mongoose logger transports | ||
if (!environment.isLocal() && exports.config.mongoose) { | ||
// initialize mongoose log model | ||
var modelName = exports.config.mongoose.model; | ||
try { | ||
if (!mongoose.model(modelName)) { | ||
exports.Log = mongoose.model(modelName, LogSchema); | ||
} else { | ||
exports.Log = mongoose.model(modelName); | ||
} | ||
} catch (e) { | ||
// initialize mongoose log model | ||
var modelName = exports.config.mongoose.model; | ||
try { | ||
if (!mongoose.model(modelName)) { | ||
exports.Log = mongoose.model(modelName, LogSchema); | ||
} else { | ||
exports.Log = mongoose.model(modelName); | ||
} | ||
} catch (e) { | ||
exports.Log = mongoose.model(modelName, LogSchema); | ||
} | ||
//mongoose logger transports | ||
if (!environment.isLocal() && exports.config.mongoose) { | ||
transports.push(new(winston.transports.Mongoose)(exports.config.mongoose)); | ||
@@ -87,0 +88,0 @@ } |
{ | ||
"name": "byteskode-logger", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "byteskode winston logger utility", | ||
@@ -38,3 +38,4 @@ "main": "index.js", | ||
"mocha": "^2.3.3", | ||
"mongoose": "^4.2.5" | ||
"mongoose": "^4.2.5", | ||
"winston-mongodb": "^1.4.0" | ||
}, | ||
@@ -41,0 +42,0 @@ "dependencies": { |
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
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
13948
10