refactor: split preload api by domain
This commit is contained in:
14
src/preload/api/logger.ts
Normal file
14
src/preload/api/logger.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { LogLevel } from '../../shared/ipc-channels'
|
||||
import { IPC_CHANNELS } from '../../shared/ipc-channels'
|
||||
import { ipcRenderer } from '../lib/ipc'
|
||||
|
||||
export const loggerApi = {
|
||||
log: (level: LogLevel, message: string, context?: Record<string, unknown>): void => {
|
||||
ipcRenderer.send(IPC_CHANNELS.LOGGER_FORWARD, {
|
||||
level,
|
||||
message,
|
||||
context,
|
||||
timestamp: Date.now()
|
||||
})
|
||||
}
|
||||
} as const
|
||||
Reference in New Issue
Block a user