From e2b096fae12a7f9e5e007a825e188333ca4a9d59 Mon Sep 17 00:00:00 2001 From: chh <1474479+chenhunghan@users.noreply.github.com> Date: Mon, 13 Sep 2021 10:56:12 +0300 Subject: [PATCH] Stop Sentry from capturing console.error and logger.error (#3785) Signed-off-by: Hung-Han (Henry) Chen --- src/common/logger.ts | 5 +---- src/common/sentry.ts | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/common/logger.ts b/src/common/logger.ts index 15506f7a46..825fa2493b 100644 --- a/src/common/logger.ts +++ b/src/common/logger.ts @@ -25,7 +25,6 @@ import type Transport from "winston-transport"; import { consoleFormat } from "winston-console-format"; import { isDebugging, isTestEnv } from "./vars"; import BrowserConsole from "winston-transport-browserconsole"; -import { SentryTransport } from "./logger-transports"; import { getPath } from "./utils/getPath"; const logLevel = process.env.LOG_LEVEL @@ -36,9 +35,7 @@ const logLevel = process.env.LOG_LEVEL ? "error" : "info"; -const transports: Transport[] = [ - new SentryTransport("error") -]; +const transports: Transport[] = []; if (ipcMain) { transports.push( diff --git a/src/common/sentry.ts b/src/common/sentry.ts index 06bef321d1..8c386c4499 100644 --- a/src/common/sentry.ts +++ b/src/common/sentry.ts @@ -19,7 +19,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import { CaptureConsole, Dedupe, Offline } from "@sentry/integrations"; +import { Dedupe, Offline } from "@sentry/integrations"; import * as Sentry from "@sentry/electron"; import { sentryDsn, isProduction } from "./vars"; import { UserStore } from "./user-store"; @@ -65,7 +65,6 @@ export function SentryInit() { }, dsn: sentryDsn, integrations: [ - new CaptureConsole({ levels: ["error"] }), new Dedupe(), new Offline(), ],