Add logger commands to comms server

This commit is contained in:
Tamius Han 2020-01-21 00:41:18 +01:00
parent 8c78715271
commit f1d2881359

View File

@ -172,6 +172,7 @@ class CommsServer {
} else if (message.cmd === 'noVideo') {
this.server.unregisterVideo(port.sender);
}
}
processReceivedMessage_nonpersistent(message, sender, sendResponse){
@ -228,6 +229,12 @@ class CommsServer {
this.settings.active.arDetect.timer_playing = timeout;
this.settings.save();
this.sendToAll({cmd: 'reload-settings', newConf: this.settings.active});
} else if (message.cmd === 'logging-stop-and-save') {
this.logger.log('info', 'CommsServer', "Received command to stop logging and export the received input");
this.logger.addLogAndExport(message.host, message.history);
} else if (message.cmd === 'logging-save') {
this.logger.log('info', 'CommsServer', `Received command to save log for site ${message.host} (tabId ${sender.tab.id}, frameId ${sender.frameId}`);
this.logger.addLogFromPage(message.host, sender.tab.id, sender.frameId, message.history);
}
}