mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
16 lines
365 B
JavaScript
16 lines
365 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, null, "\t");
|
|
}
|
|
return string;
|
|
}
|
|
|
|
module.exports = () => {
|
|
ipcRenderer.on("log", (event, log) => {
|
|
console.log(logToString(log));
|
|
});
|
|
};
|