1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-12-18 18:35:58 +01:00
upscayl/electron/utils/logit.ts
2024-10-06 12:45:44 +05:30

16 lines
428 B
TypeScript

import log from "electron-log";
import { getMainWindow } from "../main-window";
import { ELECTRON_COMMANDS } from "../../common/electron-commands";
const logit = (...args: any) => {
const mainWindow = getMainWindow();
if (!mainWindow) return;
log.log(...args);
if (process.env.NODE_ENV === "development") {
return;
}
mainWindow.webContents.send(ELECTRON_COMMANDS.LOG, args.join(" "));
};
export default logit;