Skip to content

Commit 399cea3

Browse files
fix: Improve logging
1 parent 8568a2d commit 399cea3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lambdaConnection.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function onMessageFromLambda(message: IoTMessage) {
6969

7070
if (Configuration.config.verbose) {
7171
Logger.verbose(
72-
`${message.data.functionId} response: `,
72+
`[Function ${message.data.functionId}] response: `,
7373
JSON.stringify(message.data, null, 2)
7474
);
7575
} else {
@@ -78,15 +78,15 @@ async function onMessageFromLambda(message: IoTMessage) {
7878
? JSON.stringify(message.data).substring(0, 100)
7979
: "";
8080
Logger.log(
81-
`${message.data.functionId} request: ${requestPretty}${requestPretty.length < 50 ? "" : "..."}`
81+
`[Function ${message.data.functionId}] request: ${requestPretty}${requestPretty.length < 50 ? "" : "..."}`
8282
);
8383
}
8484

8585
const response = await NodeHandler.invokeLambda(message.data);
8686

8787
if (Configuration.config.verbose) {
8888
Logger.verbose(
89-
`${message.data.functionId} response: `,
89+
`[Function ${message.data.functionId}] response: `,
9090
JSON.stringify(response, null, 2)
9191
);
9292
} else {
@@ -95,7 +95,7 @@ async function onMessageFromLambda(message: IoTMessage) {
9595
? JSON.stringify(response).substring(0, 100)
9696
: "";
9797
Logger.log(
98-
`${message.data.functionId} response: ${responsePretty}${responsePretty.length < 50 ? "" : "..."}`
98+
`[Function ${message.data.functionId}] response: ${responsePretty}${responsePretty.length < 50 ? "" : "..."}`
9999
);
100100
}
101101

0 commit comments

Comments
 (0)