diff --git a/templates/lib/triggers/trigger.js b/templates/lib/triggers/trigger.js index 8d5d14e..ba9d465 100644 --- a/templates/lib/triggers/trigger.js +++ b/templates/lib/triggers/trigger.js @@ -39,10 +39,10 @@ async function processTrigger(msg, cfg, snapshot, incomingMessageHeaders, tokenD logger.level && logger.level(logLevel); } - logger.debug("Incoming message: %j", msg); + logger.info("Incoming message: %j", msg); logger.trace("Incoming configuration: %j", cfg); - logger.debug("Incoming message headers: %j", incomingMessageHeaders); - logger.debug("Incoming token data: %j", tokenData); + logger.info("Incoming message headers: %j", incomingMessageHeaders); + logger.info("Incoming token data: %j", tokenData); if (cfg?.key && componentJson?.authFormat) { cfg.key = formatApiKey(cfg.key, componentJson.authFormat); diff --git a/templates/lib/utils/helpers.js b/templates/lib/utils/helpers.js index 7fa4c99..3f13775 100644 --- a/templates/lib/utils/helpers.js +++ b/templates/lib/utils/helpers.js @@ -73,7 +73,7 @@ const executeCall = async function (callParams) { throw new Error(body.error || "API returned erroneous response"); } - this.logger.info("Swagger response %j", { status, url, headers }); + this.logger.info("Swagger response %j", { status, url, headers, body }); if (!body) { this.logger.info("Response body is empty, going to check response data"); const data = await getResponseData.call(this, response); @@ -225,6 +225,7 @@ async function dataAndSnapshot(newElement, snapshot, snapshotKey, standardSnapsh if (compareDate(currentObjectDate, lastObjectDate)) { lastObjectDate = currentObjectDate; } + this.logger.info("Going to emit data: %j", newObject); await self.emit("data", newObject); emittedItemsCount++; } else { @@ -232,6 +233,7 @@ async function dataAndSnapshot(newElement, snapshot, snapshotKey, standardSnapsh if (compareDate(currentObjectDate, lastObjectDate)) { lastObjectDate = currentObjectDate; } + this.logger.info("Going to emit data: %j", newObject); await self.emit("data", newObject); emittedItemsCount++; } @@ -246,6 +248,7 @@ async function dataAndSnapshot(newElement, snapshot, snapshotKey, standardSnapsh } } else { this.logger.info("Found one item in response data, going to emit..."); + this.logger.info("Going to emit data: %j", newElement); await self.emit("data", newElement); } }