nativescript-sentry
nativescript-sentry copied to clipboard
Support beforeSend
trafficstars
Is there a way to support the beforeSend option? I don't want to log things when developing locally... Something like this:
Sentry.init(
{ dsn: "DSN", beforeSend: (event, hint) => {
if (IS_DEBUG) {
console.error(hint.originalException || hint.syntheticException || event);
return null;
}
return event;
}
});
@mm-spiio you can transform your Sentry.init() to something like this:
!IS_DEBUG && Sentry.init(/* your options */)
@TemaSM I don't think so. That just does not initialize Sentry if DEBUG is true. But then in the code all the "log" statements are still there and then it'd try to log them on a not-initialized sentry object.