Create readme.md

refactor and css fix

xo --fix

add inline doc

fix typo
This commit is contained in:
Araxeus
2021-04-06 21:57:16 +03:00
parent 6d44a579a4
commit 980ffb45e9
11 changed files with 306 additions and 183 deletions

View File

@ -1,11 +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);
}
return string;
}
module.exports = () => {
ipcRenderer.on("log", (event, log) => {
let string = log || log.toString();
if (!string || string === "[object Object]") {
string = JSON.stringify(log);
}
console.log(string);
})
};
ipcRenderer.on("log", (event, log) => {
console.log(logToString(log));
});
};