CaptureConsole

通过 `captureException` 或 `captureMessage` 捕获所有 Console API 调用。

Import name: Sentry.captureConsoleIntegration

此集成捕获所有 Console API 调用,并根据日志级别使用 SDK 的 captureMessagecaptureException 方法将它们重定向到 Sentry。然后重新触发以保留默认的原生行为:

Copied
import * as Sentry from "@sentry/browser";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: [Sentry.captureConsoleIntegration()],
});

类型: string[]

应捕获的方法数组。 默认值为 ['log', 'info', 'warn', 'error', 'debug', 'assert']