@middy/error-logger
Advanced tools
Comparing version 5.1.0 to 5.2.0
30
index.js
const defaults = { | ||
logger: ({ error })=>console.error(error) | ||
}; | ||
const errorLoggerMiddleware = (opts = {})=>{ | ||
let { logger } = { | ||
...defaults, | ||
...opts | ||
}; | ||
if (typeof logger !== 'function') logger = null; | ||
const errorLoggerMiddlewareOnError = async (request)=>{ | ||
logger(request); | ||
}; | ||
return { | ||
onError: logger ? errorLoggerMiddlewareOnError : null | ||
}; | ||
}; | ||
export default errorLoggerMiddleware; | ||
logger: ({ error }) => console.error(error) | ||
} | ||
const errorLoggerMiddleware = (opts = {}) => { | ||
let { logger } = { ...defaults, ...opts } | ||
if (typeof logger !== 'function') logger = null | ||
const errorLoggerMiddlewareOnError = async (request) => { | ||
logger(request) | ||
} | ||
return { | ||
onError: logger ? errorLoggerMiddlewareOnError : null | ||
} | ||
} | ||
export default errorLoggerMiddleware |
{ | ||
"name": "@middy/error-logger", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"description": "Input and output logger middleware for the middy framework", | ||
@@ -63,6 +63,6 @@ "type": "module", | ||
"devDependencies": { | ||
"@middy/core": "5.1.0", | ||
"@middy/core": "5.2.0", | ||
"@types/node": "^20.0.0" | ||
}, | ||
"gitHead": "bbdaf5843914921804ba085dd58117273febe6b5" | ||
"gitHead": "2d9096a49cd8fb62359517be96d6c93609df41f0" | ||
} |
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
6125
20