Skip to content

Commit 1afc4b6

Browse files
committed
Changelog entry moved
1 parent fb3617f commit 1afc4b6

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

CHANGELOG.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,26 @@
88
99
## Unreleased
1010

11+
### Features
12+
13+
- Add `onNativeLog` callback to intercept and forward native SDK logs to JavaScript console
14+
- The callback receives native log events with `level`, `component`, and `message` properties
15+
- Only works when `debug: true` is enabled in `Sentry.init`
16+
- Use `logWithoutTracing` inside the callback to prevent feedback loops with Sentry's console integration
17+
```js
18+
import * as Sentry from '@sentry/react-native';
19+
20+
Sentry.init({
21+
debug: true,
22+
onNativeLog: ({ level, component, message }) => {
23+
// Use logWithoutTracing to avoid feedback loops
24+
Sentry.logWithoutTracing(
25+
`[Sentry Native] [${level.toUpperCase()}] [${component}] ${message}`
26+
);
27+
},
28+
});
29+
```
30+
1131
### Fixes
1232

1333
- Resolve relative `SOURCEMAP_FILE` paths against the project root in the Xcode build script ([#5730](https://github.com/getsentry/sentry-react-native/pull/5730))
@@ -72,23 +92,6 @@
7292
],
7393
});
7494
```
75-
- Add `onNativeLog` callback to intercept and forward native SDK logs to JavaScript console
76-
- The callback receives native log events with `level`, `component`, and `message` properties
77-
- Only works when `debug: true` is enabled in `Sentry.init`
78-
- Use `logWithoutTracing` inside the callback to prevent feedback loops with Sentry's console integration
79-
```js
80-
import * as Sentry from '@sentry/react-native';
81-
82-
Sentry.init({
83-
debug: true,
84-
onNativeLog: ({ level, component, message }) => {
85-
// Use logWithoutTracing to avoid feedback loops
86-
Sentry.logWithoutTracing(
87-
`[Sentry Native] [${level.toUpperCase()}] [${component}] ${message}`
88-
);
89-
},
90-
});
91-
```
9295

9396
### Fixes
9497

0 commit comments

Comments
 (0)