-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable sentry again for new backend
- Loading branch information
Showing
1 changed file
with
12 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
import { isDevelopment } from "@/app/utils/devUtils"; | ||
import logger from "@/utils/Logger"; | ||
import * as Sentry from "@sentry/electron/main"; | ||
import * as Sentry from "@sentry/electron"; | ||
let enabledReporting = true; | ||
export const setSentryEnabled = (enable: boolean) => { | ||
if (enabledReporting !== enable) enabledReporting = enable; | ||
if (!enable) logger.child("Sentry").warn("Sentry has been disabled"); | ||
else logger.child("Sentry").warn("Sentry has been enabled"); | ||
}; | ||
|
||
if (!isDevelopment && process.type !== "renderer") { | ||
if (process.env.VUE_APP_SENTRY_DSN) | ||
Sentry.init({ | ||
dsn: process.env.VUE_APP_SENTRY_DSN, | ||
enabled: true, | ||
beforeSend: (ev) => { | ||
if (!enabledReporting) return null; | ||
return ev; | ||
}, | ||
}); | ||
else logger.child("Sentry").warn("Sentry is not enabled"); | ||
} | ||
if (process.env.VUE_APP_SENTRY_DSN) { | ||
Sentry.init({ | ||
dsn: process.env.VUE_APP_SENTRY_DSN, | ||
enabled: true, | ||
beforeSend: (ev) => { | ||
if (!enabledReporting) return null; | ||
return ev; | ||
}, | ||
}) | ||
logger.child("Sentry").info("Sentry has been initialized"); | ||
} else logger.child("Sentry").warn("Sentry is not enabled"); |