From b8b6f3a9624f6c984f24aaaeb7123a9b62afb94c Mon Sep 17 00:00:00 2001 From: sbenmoussati <51402489+sbenmoussati@users.noreply.github.com> Date: Fri, 22 Oct 2021 15:45:36 +0200 Subject: [PATCH 1/2] SDA-3416 Logs location alignment --- src/app/reports-handler.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/app/reports-handler.ts b/src/app/reports-handler.ts index 9f57e2d5..81d5547f 100644 --- a/src/app/reports-handler.ts +++ b/src/app/reports-handler.ts @@ -108,19 +108,14 @@ export const collectLogs = (): void => { */ export const packageLogs = (retrievedLogs: ILogs[]): void => { const FILE_EXTENSIONS = ['.log']; - const MAC_LOGS_PATH = '/Library/Logs/Symphony/'; - const LINUX_LOGS_PATH = '/.config/Symphony/'; - const WINDOWS_LOGS_PATH = '\\AppData\\Local\\Symphony\\Symphony\\logs'; - - const logsPath = isMac - ? MAC_LOGS_PATH - : isLinux - ? LINUX_LOGS_PATH - : WINDOWS_LOGS_PATH; - const source = app.getPath('home') + logsPath; + const logsPath = app.getPath('logs'); const focusedWindow = BrowserWindow.getFocusedWindow(); - if (!fs.existsSync(source) && focusedWindow && !focusedWindow.isDestroyed()) { + if ( + !fs.existsSync(logsPath) && + focusedWindow && + !focusedWindow.isDestroyed() + ) { logger.error(`reports-handler: Can't find any logs to share!`); dialog.showMessageBox(focusedWindow, { message: i18n.t(`Can't find any logs to share!`)(), @@ -134,7 +129,7 @@ export const packageLogs = (retrievedLogs: ILogs[]): void => { const destination = app.getPath('downloads') + destPath + timestamp + '.zip'; generateArchiveForDirectory( - source, + logsPath, destination, FILE_EXTENSIONS, retrievedLogs, From e64deb539d25a7529237e6ce88cf0494109f9551 Mon Sep 17 00:00:00 2001 From: sbenmoussati <51402489+sbenmoussati@users.noreply.github.com> Date: Fri, 22 Oct 2021 15:46:31 +0200 Subject: [PATCH 2/2] Clean up --- src/app/app-menu.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/app/app-menu.ts b/src/app/app-menu.ts index aa0a5174..e30e2144 100644 --- a/src/app/app-menu.ts +++ b/src/app/app-menu.ts @@ -550,20 +550,15 @@ export class AppMenu { private buildHelpMenu(): Electron.MenuItemConstructorOptions { logger.info(`app-menu: building help menu`); let showLogsLabel: string = i18n.t('Show Logs in Explorer')(); - if (isMac) { - showLogsLabel = i18n.t('Show Logs in Finder')(); - } - if (isLinux) { - showLogsLabel = i18n.t('Show Logs in File Manager')(); - } - let showCrashesLabel: string = i18n.t('Show crash dump in Explorer')(); if (isMac) { + showLogsLabel = i18n.t('Show Logs in Finder')(); showCrashesLabel = i18n.t('Show crash dump in Finder')(); - } - if (isLinux) { + } else if (isLinux) { + showLogsLabel = i18n.t('Show Logs in File Manager')(); showCrashesLabel = i18n.t('Show crash dump in File Manager')(); } + const { devToolsEnabled: isDevToolsEnabledCC } = this .cloudConfig as IConfig;