minor logging changes

This commit is contained in:
Dave Horton
2022-10-02 22:36:27 +01:00
parent 218f2d6c67
commit cf821569b3

View File

@@ -138,7 +138,7 @@ class WsRequestor extends BaseRequestor {
success: (response) => { success: (response) => {
clearTimeout(timer); clearTimeout(timer);
const rtt = this._roundTrip(startAt); const rtt = this._roundTrip(startAt);
this.logger.info({response}, `WsRequestor:request ${url} succeeded in ${rtt}ms`); this.logger.debug({response}, `WsRequestor:request ${url} succeeded in ${rtt}ms`);
this.stats.histogram('app.hook.ws_response_time', rtt, ['hook_type:app']); this.stats.histogram('app.hook.ws_response_time', rtt, ['hook_type:app']);
resolve(response); resolve(response);
}, },
@@ -286,7 +286,7 @@ class WsRequestor extends BaseRequestor {
const obj = JSON.parse(content); const obj = JSON.parse(content);
const {type, msgid, command, call_sid = this.call_sid, queueCommand = false, data} = obj; const {type, msgid, command, call_sid = this.call_sid, queueCommand = false, data} = obj;
this.logger.debug({obj}, 'WsRequestor:request websocket: received'); //this.logger.debug({obj}, 'WsRequestor:request websocket: received');
assert.ok(type, 'type property not supplied'); assert.ok(type, 'type property not supplied');
switch (type) { switch (type) {
@@ -323,7 +323,7 @@ class WsRequestor extends BaseRequestor {
_recvCommand(msgid, command, call_sid, queueCommand, data) { _recvCommand(msgid, command, call_sid, queueCommand, data) {
// TODO: validate command // TODO: validate command
this.logger.info({msgid, command, call_sid, queueCommand, data}, 'received command'); this.logger.debug({msgid, command, call_sid, queueCommand, data}, 'received command');
this.emit('command', {msgid, command, call_sid, queueCommand, data}); this.emit('command', {msgid, command, call_sid, queueCommand, data});
} }
} }