refactor: change log line
This commit is contained in:
parent
cc79ecd2c5
commit
9e9d18af48
1 changed files with 2 additions and 2 deletions
|
|
@ -6,8 +6,8 @@ const { logger } = require('./logger')
|
||||||
const triggerWebhook = (webhookURL, sessionId, dataType, data) => {
|
const triggerWebhook = (webhookURL, sessionId, dataType, data) => {
|
||||||
if (enableWebHook) {
|
if (enableWebHook) {
|
||||||
axios.post(webhookURL, { dataType, data, sessionId }, { headers: { 'x-api-key': globalApiKey } })
|
axios.post(webhookURL, { dataType, data, sessionId }, { headers: { 'x-api-key': globalApiKey } })
|
||||||
.then(() => logger.debug({ sessionId, dataType, data: data || '' }, `New webhook message sent to ${webhookURL}`))
|
.then(() => logger.debug({ sessionId, dataType, data: data || '' }, `Webhook message sent to ${webhookURL}`))
|
||||||
.catch(error => logger.error({ sessionId, dataType, err: error, data: data || '' }, `Failed to send new webhook message to ${webhookURL}`))
|
.catch(error => logger.error({ sessionId, dataType, err: error, data: data || '' }, `Failed to send webhook message to ${webhookURL}`))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue