add unresponsive listener

This commit is contained in:
Araxeus
2021-04-10 02:51:38 +03:00
parent 3d41d04818
commit 09d9f72db2
4 changed files with 39 additions and 19 deletions

15
providers/frontLogger.js Normal file
View File

@ -0,0 +1,15 @@
const { ipcRenderer } = require("electron");
function logToString(log) {
let string = (typeof log === "string") ? log : log.toString();
if (!string || string.includes("[object Object]")) {
string = JSON.stringify(log, null, "\t");
}
return string;
}
module.exports = () => {
ipcRenderer.on("log", (event, log) => {
console.log(logToString(log));
});
};