Skip to content
This repository has been archived by the owner on Nov 14, 2020. It is now read-only.

Support beforeSend #42

Open
mm-spiio opened this issue May 14, 2020 · 2 comments
Open

Support beforeSend #42

mm-spiio opened this issue May 14, 2020 · 2 comments

Comments

@mm-spiio
Copy link

mm-spiio commented May 14, 2020

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; 
    }
}); 
@TemaSM
Copy link

TemaSM commented May 17, 2020

@mm-spiio you can transform your Sentry.init() to something like this:

!IS_DEBUG && Sentry.init(/* your options */)

@mm-spiio
Copy link
Author

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants