添加错误日志

This commit is contained in:
yj 2024-12-09 11:51:41 +08:00
parent a20c833de0
commit 4fbcf0e319
1 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,7 @@ const {
ipcMain, ipcMain,
clipboard, clipboard,
dialog, dialog,
crashReporter,
desktopCapturer, desktopCapturer,
} = require('electron'); } = require('electron');
const path = require('node:path') const path = require('node:path')
@ -100,6 +101,11 @@ const additionalData = { myKey: 'myValue' }
app.on('ready', () => { app.on('ready', () => {
const gotTheLock = app.requestSingleInstanceLock(additionalData) const gotTheLock = app.requestSingleInstanceLock(additionalData)
if (gotTheLock) { if (gotTheLock) {
app.getPath('crashDumps')
crashReporter.start({
uploadToServer: false,
ignoreSystemCrashHandler: false
})
env = process.argv.find((arg) => arg.startsWith('--env='))?.split('=')[1]; env = process.argv.find((arg) => arg.startsWith('--env='))?.split('=')[1];
if (env === 'development') { if (env === 'development') {
Object.defineProperty(app, 'isPackaged', { Object.defineProperty(app, 'isPackaged', {