mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-09-27 20:11:15 +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:
@@ -19,6 +19,7 @@ const config = require("../config");
|
||||
const { validateDownloadPath, getDefaultDownloadPath } = require("./pathValidator");
|
||||
const { userThemesPath } = require("../server/helpers/path.helpers");
|
||||
const { createSystemTray, destroyTray } = require("./tray");
|
||||
const {sendReport} = require("./sendReport");
|
||||
|
||||
/**
|
||||
* Security whitelist for feature flags that can be modified at runtime.
|
||||
@@ -180,8 +181,13 @@ function registerIpcHandlers(getMainWindow) {
|
||||
*/
|
||||
ipcMain.on("open-config", () => shell.openPath(configFolderPath));
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Front end logger
|
||||
*/
|
||||
ipcMain.on("log-error", (_, message) => logger.error(`[Frontend] ${message}`));
|
||||
ipcMain.on("log-info", (_, message) => logger.info(`[Frontend] ${message}`));
|
||||
ipcMain.on("log-warn", (_, message) => logger.warn(`[Frontend] ${message}`));
|
||||
|
||||
/**
|
||||
* Retrieves available themes from filesystem.
|
||||
*/
|
||||
@@ -199,6 +205,13 @@ function registerIpcHandlers(getMainWindow) {
|
||||
return await reloadThemes();
|
||||
});
|
||||
|
||||
/**
|
||||
* Send bug report
|
||||
*/
|
||||
ipcMain.handle("send-report", async (_, params) => {
|
||||
return await sendReport(params);
|
||||
})
|
||||
|
||||
/**
|
||||
* Updates a runtime feature flag and persists it to disk.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user