添加错误日志

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