@cityofsurrey/woodie
Advanced tools
Comparing version 1.0.4 to 1.0.5
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _bunyan = require('bunyan'); | ||
@@ -23,8 +27,7 @@ | ||
if (err || status >= 500) { | ||
// server internal error or error | ||
return 'error'; | ||
} else if (status >= 400) { | ||
// client error | ||
return 'warn'; | ||
} | ||
return 'info'; | ||
@@ -39,11 +42,3 @@ }; | ||
module.exports = function () { | ||
var logger = module.exports.errorLogger(); | ||
return function (req, res, next) { | ||
logger(null, req, res, next); | ||
}; | ||
}; | ||
module.exports.errorLogger = function () { | ||
var createLogger = function createLogger() { | ||
return function (err, req, res, next) { | ||
@@ -54,8 +49,3 @@ var startTime = process.hrtime(); | ||
var logger = _bunyan2.default.createLogger({ | ||
name: 'express', | ||
serializers: { | ||
req: _bunyan2.default.stdSerializers.req, | ||
res: _bunyan2.default.stdSerializers.res, | ||
err: _bunyan2.default.stdSerializers.err | ||
} | ||
name: 'express' | ||
}); | ||
@@ -101,4 +91,4 @@ var childLogger = requestId !== undefined ? logger.child({ req_id: requestId }) : logger; | ||
var metaWithoutSensitiveData = (0, _omitDeep2.default)(meta, ['cvv', 'password']); | ||
logFn.call(childLogger, metaWithoutSensitiveData); | ||
var metaWithoutSensitiveProperties = (0, _omitDeep2.default)(meta, ['cvv', 'password', 'variables']); | ||
logFn.call(childLogger, metaWithoutSensitiveProperties); | ||
}; | ||
@@ -130,2 +120,10 @@ | ||
}; | ||
}; | ||
exports.default = function () { | ||
var logger = createLogger(); | ||
return function (req, res, next) { | ||
logger(null, req, res, next); | ||
}; | ||
}; |
{ | ||
"name": "@cityofsurrey/woodie", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "City of Surrey Logging Service", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
import omit from 'omit-deep' | ||
import replace from './src/replace' | ||
const meta = { | ||
req: { | ||
variables: '{\n \"input\": {\n \"orderId\": \"P-IPS-1-1532197587238\",\n \"card\": {\n \"name\": \"Slava\",\n \"cvv\": \"123\",\n \"expiry\": {\n \"month\": 2,\n \"year\": 2020\n },\n \"token\": \"abc\"\n }\n }\n}', | ||
body: { | ||
@@ -22,2 +25,5 @@ input: { | ||
console.log(JSON.stringify(omit(meta, 'cvv'))) | ||
// const result = omit(meta, 'cvv') | ||
const result = replace(meta, ['cvv', 'password']) | ||
console.log(JSON.stringify(result)) |
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
7025