This package provides a middy Middleware that logs requests and responses. It is based on @middy/input-out-logger middleware.
@middy/input-out-logger is great but since it requires @middy/core I decided to create something that was useful for all those that still work with middy.
$ npm install middy-awesome-logs
logger property accept a function (default console.log).
const middy = require('middy');
const awesomeLogs = require('middy-awesome-logs');
const handler = middy((event, context, cb) => {
const response = {
statusCode: 200,
headers: {},
body: JSON.stringify({ message: 'hello world' })
};
callback(null, response)
});
handler.use(awesomeLogs());