Skip to content

Commit 7cf4457

Browse files
authored
build: add SENTRY_DEBUG_DEV ENV to turn off Sentry Logger (#13407)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Adds SENTRY_DEBUG_DEV ENV variable to turn off Sentry Logger debug ## **Related issues** Fixes: ## **Manual testing steps** 1. Add `SENTRY_DEBUG_DEV` to js.env 2. Run simulation and run Flipper `yarn start:flipper` 3. Observe console ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Example Before** ![CleanShot 2025-02-07 at 21 01 13](https://github.com/user-attachments/assets/aa3c0b95-a94b-43a2-b6f2-3efc880b78ee) ### **Example After** ![CleanShot 2025-02-07 at 20 48 42](https://github.com/user-attachments/assets/47cdb751-b604-455e-a178-db90e5bc1ead) ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent fb48175 commit 7cf4457

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.js.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ export MM_FOX_CODE="EXAMPLE_FOX_CODE"
1818

1919
export MM_INFURA_PROJECT_ID="null"
2020
export IGNORE_BOXLOGS_DEVELOPMENT="false"
21+
22+
# Sentry.init dsn value
2123
export MM_SENTRY_DSN=""
24+
# Sentry.init debug option is set to true in dev environments by default. Set this to "false" to turn it off
25+
export SENTRY_DEBUG_DEV="false"
2226
# Determines if Sentry will auto upload source maps and debug files. Disabled by default
2327
export SENTRY_DISABLE_AUTO_UPLOAD="true"
2428

app/util/sentry/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ export function setupSentry() {
546546

547547
Sentry.init({
548548
dsn,
549-
debug: isDev,
549+
debug: isDev && process.env.SENTRY_DEBUG_DEV !== 'false',
550550
environment,
551551
integrations,
552552
// Set tracesSampleRate to 1.0, as that ensures that every transaction will be sent to Sentry for development builds.

0 commit comments

Comments
 (0)