Skip to content

Commit

Permalink
feat: enable sentry again for new backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Venipa committed Oct 28, 2024
1 parent 6129193 commit f00cd87
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/app/utils/sentry.ts
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");

0 comments on commit f00cd87

Please sign in to comment.