From f7c49c37f6a5c99e83ac1ce65f6655141bdbb828 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Thu, 15 Jul 2021 17:36:13 +0700 Subject: [PATCH] fix: sentry logging --- client/src/lib/env.ts | 1 + client/src/lib/logging.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/lib/env.ts b/client/src/lib/env.ts index 2b97407..c533b9c 100644 --- a/client/src/lib/env.ts +++ b/client/src/lib/env.ts @@ -1,4 +1,5 @@ export default { API_ENDPOINT: import.meta.env.VITE_API_ENDPOINT, SENTRY_DSN: import.meta.env.VITE_SENTRY_DSN, + NODE_ENV: import.meta.env.VITE_NODE_ENV, }; diff --git a/client/src/lib/logging.ts b/client/src/lib/logging.ts index 9f66074..b66a42b 100644 --- a/client/src/lib/logging.ts +++ b/client/src/lib/logging.ts @@ -2,7 +2,8 @@ import * as Sentry from '@sentry/browser'; import env from './env'; Sentry.init({ - dsn: String(env.SENTRY_DSN), + dsn: String(env.SENTRY_DSN) || '', + enabled: String(env.NODE_ENV) === 'production', tracesSampleRate: 0.5, });