Merge pull request #1273 from sbenmoussati/bugfix/SDA-logger

SDA-3416 Logs location alignment
This commit is contained in:
Salah Benmoussati 2021-10-25 10:07:55 +02:00 committed by GitHub
commit 94f6a62d49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 21 deletions

View File

@ -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;

View File

@ -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,