2023-09-10 19:42:18 +02:00
|
|
|
import log from "electron-log";
|
|
|
|
import { getMainWindow } from "../main-window";
|
2024-10-06 09:15:44 +02:00
|
|
|
import { ELECTRON_COMMANDS } from "../../common/electron-commands";
|
2023-09-10 11:14:04 +02:00
|
|
|
|
|
|
|
const logit = (...args: any) => {
|
2023-09-10 19:42:18 +02:00
|
|
|
const mainWindow = getMainWindow();
|
2023-09-10 11:14:04 +02:00
|
|
|
if (!mainWindow) return;
|
2023-09-10 19:42:18 +02:00
|
|
|
log.log(...args);
|
2024-02-09 13:56:04 +01:00
|
|
|
if (process.env.NODE_ENV === "development") {
|
|
|
|
return;
|
|
|
|
}
|
2024-10-04 11:15:54 +02:00
|
|
|
mainWindow.webContents.send(ELECTRON_COMMANDS.LOG, args.join(" "));
|
2023-09-10 11:14:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default logit;
|