File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments