minor logging changes

This commit is contained in:
Dave Horton
2024-01-27 12:59:23 -05:00
parent a7fa2f95dd
commit 0491c5ce25

View File

@@ -65,18 +65,17 @@ class BackgroundTaskManager extends Emitter {
// Remove task from managed List // Remove task from managed List
this.tasks.delete(type); this.tasks.delete(type);
} else { } else {
this.logger.info(`stopping background task, ${type} is not running, skipped`); this.logger.debug(`stopping background task, ${type} is not running, skipped`);
} }
} }
stopAll() { stopAll() {
this.logger.info('BackgroundTaskManager:stopAll'); this.logger.debug('BackgroundTaskManager:stopAll');
for (const key of this.tasks.keys()) { for (const key of this.tasks.keys()) {
this.stop(key); this.stop(key);
} }
} }
// Initiate Task
// Initiate Listen // Initiate Listen
async _initListen(opts, bugname = 'jambonz-background-listen', ignoreCustomerData = false, type = 'listen') { async _initListen(opts, bugname = 'jambonz-background-listen', ignoreCustomerData = false, type = 'listen') {
let task; let task;
@@ -176,7 +175,7 @@ class BackgroundTaskManager extends Emitter {
} }
_taskCompleted(type, task) { _taskCompleted(type, task) {
this.logger.info({type, task}, 'BackgroundTaskManager:_taskCompleted: task completed'); this.logger.debug({type, task}, 'BackgroundTaskManager:_taskCompleted: task completed');
task.removeAllListeners(); task.removeAllListeners();
task.span.end(); task.span.end();
this.tasks.delete(type); this.tasks.delete(type);
@@ -189,7 +188,7 @@ class BackgroundTaskManager extends Emitter {
} }
_bargeInTaskCompleted(evt) { _bargeInTaskCompleted(evt) {
this.logger.info({evt}, 'BackgroundTaskManager:_bargeInTaskCompleted on event from background bargeIn'); this.logger.debug({evt}, 'BackgroundTaskManager:_bargeInTaskCompleted on event from background bargeIn');
this.emit('bargeIn-done', evt); this.emit('bargeIn-done', evt);
} }
} }