Skip to content

Commit fb3617f

Browse files
committed
Changelog entry
1 parent f27e050 commit fb3617f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,23 @@
7272
],
7373
});
7474
```
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+
```
7592

7693
### Fixes
7794

0 commit comments

Comments
 (0)