Skip to content

Commit

Permalink
fix: handle case where logger lambda is undefined (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
olikirkness authored Jun 11, 2021
1 parent 5685b9f commit c82ca79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/tailLogsForLambdas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ const tailLogsForLambdas = async (
realTimeLogsFunctionMap[key].map(({functionName}) => functionName),
)
.on('log', (log) => {
loggers[log.lambda].log(...log.log);
if (loggers[log.lambda]) {
loggers[log.lambda].log(...log.log);
} else {
// eslint-disable-next-line no-console
console.log(...log.log);
}
})
.on('disconnect', () => {
// eslint-disable-next-line no-console
Expand Down

0 comments on commit c82ca79

Please sign in to comment.