Skip to content

Commit

Permalink
chore: Disable sentry in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
v-almonacid committed Nov 29, 2023
1 parent b6ca6a7 commit c5eb079
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/frontend/src/api/utils/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export enum ELogLevel {

let logLevel: ELogLevel;

const notProd = CONFIG.IS_DEV || CONFIG.IS_STAGING;
const notProd = CONFIG.IS_LOCAL || CONFIG.IS_DEV || CONFIG.IS_STAGING;

logLevel = ((): ELogLevel => {
if (LOGLEVEL in ELogLevel) {
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export enum EEnvironments {
}

const IS_TEST = import.meta.env.VITE_ENVIRONMENT === EEnvironments.Test;
const IS_LOCAL = import.meta.env.MODE === "development" && import.meta.env.DEV;
const IS_DEV =
import.meta.env.VITE_ENVIRONMENT === EEnvironments.Development ||
!import.meta.env.VITE_ENVIRONMENT;
Expand Down Expand Up @@ -60,6 +61,7 @@ export type TFeatureEnvironment = EEnvironments | "none";
const CONFIG = {
ENVIRONMENT,
IS_TEST,
IS_LOCAL,
IS_DEV,
IS_STAGING,
IS_PROD,
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ try {
const { cookieChoice } = JSON.parse(persistedState?.ui || "{}");
if (
CONFIG.SENTRY.ENABLE &&
!CONFIG.IS_LOCAL &&
(!CONFIG.IS_PROD ||
(cookieChoice != null &&
typeof cookieChoice === "number" &&
Expand Down

0 comments on commit c5eb079

Please sign in to comment.