8000 Debug mode flag that enables main logger · lordnox/sentry-javascript@7f9908a · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit 7f9908a

Browse files
committed
Debug mode flag that enables main logger
1 parent c5db814 commit 7f9908a

File tree

7 files changed

+12
-15
lines changed

7 files changed

+12
-15
lines changed

packages/browser/src/sdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import {
77
GlobalHandlers,
88
InboundFilters,
99
SDKInformation,
10-
// TryCatch,
10+
TryCatch,
1111
} from './integrations';
1212

1313
export const defaultIntegrations = [
1414
new FunctionToString(),
15-
// new TryCatch(),
15+
new TryCatch(),
1616
new Breadcrumbs(),
1717
new SDKInformation(),
1818
new GlobalHandlers(),

packages/core/src/base.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ export abstract class BaseClient<B extends Backend, O extends Options> implement
133133
* @inheritDoc
134134
*/
135135
public async captureEvent(event: SentryEvent, scope?: Scope): Promise<SentryResponse> {
136-
// TODO: Notify developers that it's impossible to call `captureX` methods
137-
// without calling `init` in the first place
138136
return this.processEvent(event, async finalEvent => this.getBackend().sendEvent(finalEvent), scope);
139137
}
140138

packages/core/src/interfaces.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export enum LogLevel {
2424

2525
/** Base configuration options for every SDK. */
2626
export interface Options {
27+
/**
28+
* Enable debug functionality in the SDK itself
29+
*/
30+
debug?: boolean;
31+
2732
/**
2833
* Specifies whether this SDK should activate and send events to Sentry.
2934
* Disabling the SDK reduces all overhead from instrumentation, collecting

packages/core/src/sdk.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ export function initAndBind<F extends Client, O extends Options>(
2525
return;
2626
}
2727

28-
// TODO: Options.debug? Options.enableLogger?
29-
logger.enable();
28+
if (options.debug) {
29+
logger.enable();
30+
}
3031

3132
const client = new clientClass(options);
3233
client.install();

packages/minimal/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function callOnHub(method: string, ...args: any[]): void {
2121
export function captureException(exception: any): void {
2222
let syntheticException: Error;
2323
try {
24-
// TODO: Get message from captureException call in case we pass it a non-Error type?
2524
throw new Error('Sentry syntheticException');
2625
} catch (exception) {
2726
syntheticException = exception as Error;

packages/node/src/backend.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export class NodeBackend implements Backend {
3434
const keys = Object.keys(exception as {}).sort();
3535
const message = `Non-Error exception captured with keys: ${serializeKeysToEventMessage(keys)}`;
3636

37-
// TODO: We also set `event.message` here previously, check if it works without it as well
3837
getDefaultHub().configureScope(scope => {
3938
scope.setExtra('__serialized__', limitObjectDepthToSize(exception as {}));
4039
scope.setFingerprint([md5(keys.join(''))]);

packages/utils/package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,9 @@
4343
"transform": {
4444
"^.+\\.ts$": "ts-jest"
4545
},
46-
"moduleFileExtensions": [
47-
"js",
48-
"ts"
49-
],
46+
"moduleFileExtensions": ["js", "ts"],
5047
"testEnvironment": "node",
51-
"testMatch": [
52-
"**/*.test.ts"
53-
],
48+
"testMatch": ["**/*.test.ts"],
5449
"globals": {
5550
"ts-jest": {
5651
"tsConfigFile": "./tsconfig.json"

0 commit comments

Comments
 (0)
0