diff --git a/src/main/MainRunner.ts b/src/main/MainRunner.ts index cb8a8aa..e765426 100644 --- a/src/main/MainRunner.ts +++ b/src/main/MainRunner.ts @@ -7,6 +7,7 @@ import { import Constants, { TrayOptions } from './utils/Constants' import IPCs from './IPCs' import { createTray, hideWindow, showWindow } from './tray' +import log from 'electron-log/main' const options = { width: Constants.IS_DEV_ENV ? 1500 : 1200, @@ -28,6 +29,8 @@ const exitApp = (mainWindow: BrowserWindow): void => { } export const createMainWindow = async (): Promise => { + log.silly('Creating new window...') + let opt: BrowserWindowConstructorOptions = { title: Constants.APP_NAME, show: false, diff --git a/src/main/index.ts b/src/main/index.ts index c59d90a..17609c4 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -16,6 +16,8 @@ const initializeMainLogger = () => { log.transports.file.format = '[{y}{m}{d} {h}:{i}:{s}.{ms}|{level}]{text}' log.transports.console.format = '{h}:{i}:{s}.{ms} {text}' log.transports.console.level = 'silly' + + log.silly('App is ready') } app.on('ready', async () => { diff --git a/src/preload/index.ts b/src/preload/index.ts index daa82ce..e6e5d2f 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -18,7 +18,7 @@ contextBridge.exposeInMainWorld('mainApi', { if (mainAvailChannels.includes(channel)) { ipcRenderer.send.apply(null, [channel, ...data]) if (process.env.NODE_ENV === 'development') { - console.log({ type: 'send', channel, request: data }) + log.silly(`[IPC_SEND::${channel}]`, { request: data }) } } else { throw new Error(`Unknown ipc channel name: ${channel}`) @@ -58,7 +58,10 @@ contextBridge.exposeInMainWorld('mainApi', { if (mainAvailChannels.includes(channel)) { const result = await ipcRenderer.invoke.apply(null, [channel, ...data]) if (process.env.NODE_ENV === 'development') { - console.log({ type: 'invoke', channel, request: data, result }) + log.silly(`[IPC_INVOKE::${channel}]`, { + request: data, + result + }) } return result }