Skip to content

Commit c18f888

Browse files
authored
fix: debug: true should result in debug output (#990)
1 parent fe08d69 commit c18f888

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

src/main/sdk.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
setNodeAsyncContextStrategy,
1717
} from '@sentry/node';
1818
import { Integration, Options } from '@sentry/types';
19-
import { stackParserFromStackParserOptions } from '@sentry/utils';
19+
import { logger, stackParserFromStackParserOptions } from '@sentry/utils';
2020
import { Session, session, WebContents } from 'electron';
2121

2222
import { IPCMode } from '../common/ipc';
@@ -153,6 +153,10 @@ export function init(userOptions: ElectronMainOptions): void {
153153
integrations: getIntegrationsToSetup(optionsWithDefaults),
154154
};
155155

156+
if (options.debug) {
157+
logger.enable();
158+
}
159+
156160
removeRedundantIntegrations(options);
157161
configureIPC(options);
158162

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "debug-output",
3+
"version": "1.0.0",
4+
"main": "src/main.js",
5+
"dependencies": {
6+
"@sentry/electron": "3.0.0"
7+
}
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: Has Debug Output
2+
command: yarn
3+
expectedError: "Initializing Sentry: process"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { init } = require('@sentry/electron/main');
2+
const { app } = require('electron');
3+
4+
init({
5+
dsn: '__DSN__',
6+
debug: true,
7+
autoSessionTracking: false,
8+
onFatalError: () => {},
9+
});
10+
11+
setTimeout(() => {
12+
app.quit();
13+
}, 3000);

0 commit comments

Comments
 (0)