The factory function createLogger()assumes that an APIGatewayProxyEvent is always available. This doesn't hold true for lambdas triggered by other mechanisms e.g. CloudWatch scheduled events or DynamoDB triggers.
This coupling between the lambda handler and the logger factory is unnecessary and should be removed.
The factory function
createLogger()
assumes that anAPIGatewayProxyEvent
is always available. This doesn't hold true for lambdas triggered by other mechanisms e.g. CloudWatch scheduled events or DynamoDB triggers.This coupling between the lambda handler and the logger factory is unnecessary and should be removed.