Files
youtube-music/providers/logger.js
Araxeus 980ffb45e9 Create readme.md
refactor and css fix

xo --fix

add inline doc

fix typo
2021-04-06 21:57:16 +03:00

16 lines
353 B
JavaScript

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) => {
console.log(logToString(log));
});
};