Skip to content

4.1.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 10 Jun 11:55

Features

  • Add onNativeLog callback to intercept and forward native SDK logs to JavaScript console (#1249)
    • The callback receives native log events with level, component, and message properties

    • Only works when debug: true is enabled in Sentry.init

    • Use consoleSandbox inside the callback to prevent feedback loops with Sentry's console integration

      import * as Sentry from '@sentry/capacitor';
      
      Sentry.init({
        debug: true,
        onNativeLog: ({ level, component, message }) => {
          // Use consoleSandbox to avoid feedback loops
          Sentry.consoleSandbox(() => {
            console.log(
              `[Sentry Native] [${level.toUpperCase()}] [${component}] ${message}`,
            );
          });
        },
      });
  • Add strictTraceContinuation and orgId options for trace continuation validation (#1166)

Dependencies