Configuring raven-js to use console only in dev

When in dev, I prefer to have all exceptions and messages print to console, because I won’t be sending them to any Sentry server. What is the recommended way to do this?

Recommendations I’ve seen from browsing GitHub issues include:

  • Still install() Raven but with a false DSN will mean it won’t send events externally (which is a good start)
  • Setting Raven.debug = true will dump to console but it’s not really that “developer-friendly” if you just want to see stack traces when developing - you need to dig into the Objects to work out what’s going on.

Right now I’ve chosen to Polyfill window.Raven myself (only the functions I use) and dump to console that way, but it doesn’t feel optimal. Any better ideas?

Another option I forgot to mention for suppressing external sending is to hack shouldSendCallback in dev, e.g.

{
  shouldSendCallback: function(data) {
    return false;
  }
}