Enable crash reporting for all channels
This commit is contained in:
parent
aa5208ac24
commit
32223acf5b
2 changed files with 4 additions and 26 deletions
|
@ -9,7 +9,6 @@ import z from 'zod';
|
|||
|
||||
import type { LoggerType } from '../ts/types/Logging';
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { isProduction } from '../ts/util/version';
|
||||
import OS from '../ts/util/os/osMain';
|
||||
|
||||
const dumpSchema = z
|
||||
|
@ -65,21 +64,12 @@ async function eraseDumps(
|
|||
|
||||
export function setup(
|
||||
getLogger: () => LoggerType,
|
||||
showDebugLogWindow: () => Promise<void>,
|
||||
forceEnable = false
|
||||
showDebugLogWindow: () => Promise<void>
|
||||
): void {
|
||||
const isEnabled = !isProduction(app.getVersion()) || forceEnable;
|
||||
|
||||
if (isEnabled) {
|
||||
getLogger().info(`crashReporter: ${forceEnable ? 'force ' : ''}enabled`);
|
||||
crashReporter.start({ uploadToServer: false });
|
||||
}
|
||||
getLogger().info('crashReporter: enabled');
|
||||
crashReporter.start({ uploadToServer: false });
|
||||
|
||||
ipc.handle('crash-reports:get-count', async () => {
|
||||
if (!isEnabled) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const pendingDumps = await getPendingDumps();
|
||||
if (pendingDumps.length !== 0) {
|
||||
getLogger().warn(
|
||||
|
@ -90,10 +80,6 @@ export function setup(
|
|||
});
|
||||
|
||||
ipc.handle('crash-reports:write-to-log', async () => {
|
||||
if (!isEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const pendingDumps = await getPendingDumps();
|
||||
if (pendingDumps.length === 0) {
|
||||
return;
|
||||
|
@ -133,10 +119,6 @@ export function setup(
|
|||
});
|
||||
|
||||
ipc.handle('crash-reports:erase', async () => {
|
||||
if (!isEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const pendingDumps = await getPendingDumps();
|
||||
|
||||
await eraseDumps(getLogger(), pendingDumps);
|
||||
|
|
|
@ -207,13 +207,9 @@ const defaultWebPrefs = {
|
|||
const DISABLE_GPU =
|
||||
OS.isLinux() && !process.argv.some(arg => arg === '--enable-gpu');
|
||||
|
||||
const FORCE_ENABLE_CRASH_REPORTS = process.argv.some(
|
||||
arg => arg === '--enable-crash-reports'
|
||||
);
|
||||
|
||||
const CLI_LANG = cliOptions.lang as string | undefined;
|
||||
|
||||
setupCrashReports(getLogger, showDebugLogWindow, FORCE_ENABLE_CRASH_REPORTS);
|
||||
setupCrashReports(getLogger, showDebugLogWindow);
|
||||
|
||||
let sendDummyKeystroke: undefined | (() => void);
|
||||
if (OS.isWindows()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue