From d484771455f8dd66794f85cda57d031f84de0052 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Tue, 14 Jan 2025 14:40:03 -0500 Subject: [PATCH] log gather payload at info --- lib/tasks/gather.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index da90ddde..365e5f4e 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -1137,15 +1137,18 @@ class TaskGather extends SttTask { if (this.parentTask) this.parentTask.emit('dtmf', evt); else { this.emit('dtmf', evt); - returnedVerbs = await this.performAction({digits: this.digitBuffer, reason: 'dtmfDetected'}); + const payload = {digits: this.digitBuffer, reason: 'dtmfDetected'}; + this.logger.info({payload}, 'TaskGather:_resolve - sending dtmf event to app'); + returnedVerbs = await this.performAction(payload); } } else if (reason.startsWith('speech')) { if (this.parentTask) this.parentTask.emit('transcription', evt); else { this.emit('transcription', evt); - this.logger.debug('TaskGather:_resolve - invoking performAction'); - returnedVerbs = await this.performAction({speech: evt, reason: 'speechDetected'}); + const payload = {speech: evt, reason: 'speechDetected'}; + this.logger.info({payload}, 'TaskGather:_resolve - sending speech transcript to app'); + returnedVerbs = await this.performAction(payload); this.logger.debug({returnedVerbs}, 'TaskGather:_resolve - back from performAction'); } } @@ -1153,6 +1156,7 @@ class TaskGather extends SttTask { if (this.parentTask) this.parentTask.emit('timeout', evt); else { this.emit('timeout', evt); + this.logger.info('TaskGather:_resolve - sending timeout event to app'); returnedVerbs = await this.performAction({reason: 'timeout'}); } } @@ -1160,12 +1164,15 @@ class TaskGather extends SttTask { if (this.parentTask) this.parentTask.emit('stt-error', evt); else { this.emit('stt-error', evt); - returnedVerbs = await this.performAction({reason: 'error', details: evt.error}); + const payload = {reason: 'stt-error', details: evt.error}; + this.logger.info({payload}, 'TaskGather:_resolve - sending stt-error event to app'); + returnedVerbs = await this.performAction(payload); } } else if (reason.startsWith('stt-low-confidence')) { if (this.parentTask) this.parentTask.emit('stt-low-confidence', evt); else { this.emit('stt-low-confidence', evt); + this.logger.info('TaskGather:_resolve - sending stt-low-confidence event to app'); returnedVerbs = await this.performAction({reason: 'stt-low-confidence'}); } }