Skip to content

Commit 11ff5b1

Browse files
lforstLms24
andauthored
Replace deprecated severity enums with string literals (#4940)
Co-authored-by: Lukas Stracke <[email protected]>
1 parent 4a5cdbf commit 11ff5b1

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

src/includes/enriching-events/breadcrumbs/breadcrumbs-example/javascript.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
Sentry.addBreadcrumb({
33
category: "auth",
44
message: "Authenticated user " + user.email,
5-
level: Sentry.Severity.Info,
5+
level: "info",
66
});
77
```

src/includes/set-level/javascript.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ To set the level out of scope, you can call `captureMessage()` per event:
44
Sentry.captureMessage("this is a debug message", "debug");
55
```
66

7+
Available levels are `"fatal"`, `"critical"`, `"error"`, `"warning"`, `"log"`, `"info"`, and `"debug"`.
8+
79
To set the level within scope, you can call `setLevel()`:
810

911
```javascript
1012
Sentry.configureScope(function(scope) {
11-
scope.setLevel(Sentry.Severity.Warning);
13+
scope.setLevel("warning");
1214
});
1315
```
1416

@@ -20,8 +22,8 @@ Sentry.withScope(function(scope) {
2022

2123
// The exception has the event level set by the scope (info).
2224
Sentry.captureException(new Error("custom error"));
23-
2425
});
26+
2527
// Outside of withScope, the Event level will have their previous value restored.
2628
// The exception has the event level set (error).
2729
Sentry.captureException(new Error("custom error 2"));

src/platforms/common/enriching-events/breadcrumbs.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ The available breadcrumb keys are `type`, `category`, `message`, `level`, `times
4141

4242
</PlatformSection>
4343

44+
<PlatformSection supported={["javascript", "node"]}>
45+
46+
You can choose from the following breadcrumb log levels: `"fatal"`, `"critical"`, `"error"`, `"warning"`, `"log"`, `"info"`, and `"debug"`.
47+
48+
</PlatformSection>
49+
4450
<PlatformSection notSupported={["native", "unreal"]}>
4551

4652
## Automatic Breadcrumbs

src/platforms/javascript/common/troubleshooting/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,12 @@ document.body.addEventListener(
395395
if (event.target.tagName === "IMG") {
396396
Sentry.captureMessage(
397397
`Failed to load image: ${event.target.src}`,
398-
Sentry.Severity.Warning
398+
"warning"
399399
);
400400
} else if (event.target.tagName === "LINK") {
401401
Sentry.captureMessage(
402402
`Failed to load css: ${event.target.href}`,
403-
Sentry.Severity.Warning
403+
"warning"
404404
);
405405
}
406406
},

0 commit comments

Comments
 (0)