mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 19:31:46 +00:00
add unresponsive listener
This commit is contained in:
15
providers/frontLogger.js
Normal file
15
providers/frontLogger.js
Normal 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));
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user