Skip to content

Commit

Permalink
feat(logger): support cases of missing context
Browse files Browse the repository at this point in the history
  • Loading branch information
rwhite-lightbox authored and naorpeled committed Jun 10, 2024
1 parent 56a4cff commit 0450e12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ exports.config = (config, levels) => {
return {};
},
context: (context) => {
if(!context) return {};

return {
remaining:
context.getRemainingTimeInMillis &&
context.getRemainingTimeInMillis(),
remaining: context.getRemainingTimeInMillis && context.getRemainingTimeInMillis(),
function: context.functionName && context.functionName,
memory: context.memoryLimitInMB && context.memoryLimitInMB,
};
Expand Down

0 comments on commit 0450e12

Please sign in to comment.