mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-09-28 12:31:14 +02:00
feat: send logs feature that send logs to a distant service. Full integration in ui
+ expose logger method to frontEnd (#53)
This commit is contained in:
29
preload.js
29
preload.js
@@ -9,6 +9,35 @@ const { contextBridge, ipcRenderer } = require("electron");
|
||||
*/
|
||||
contextBridge.exposeInMainWorld("electronAPI", {
|
||||
|
||||
/**
|
||||
* Sends error log message.
|
||||
*
|
||||
* @param {...any} args - Values to log
|
||||
*/
|
||||
logError: (...args) => ipcRenderer.send("log-error", args.map(arg => typeof arg === "object" ? JSON.stringify(arg) : arg).join(" ")),
|
||||
|
||||
/**
|
||||
* Sends info log message.
|
||||
*
|
||||
* @param {...any} args - Values to log
|
||||
*/
|
||||
logInfo: (...args) => ipcRenderer.send("log-info", args.map(arg => typeof arg === "object" ? JSON.stringify(arg) : arg).join(" ")),
|
||||
|
||||
/**
|
||||
* Sends warning log message.
|
||||
*
|
||||
* @param {...any} args - Values to log
|
||||
*/
|
||||
logWarn: (...args) => ipcRenderer.send("log-warn", args.map(arg => typeof arg === "object" ? JSON.stringify(arg) : arg).join(" ")),
|
||||
|
||||
/**
|
||||
* Send Bug Report
|
||||
*
|
||||
* @param params
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
sendReport: (params) => ipcRenderer.invoke('send-report', params),
|
||||
|
||||
/**
|
||||
* Return process.platform to renderer
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user