Sentry-javascript: Wire up console.warn/console.error to Raven.captureMessage

Created on 14 Mar 2013  路  6Comments  路  Source: getsentry/sentry-javascript

Explicitly monkey patch console.* as log levels.

All 6 comments


I'm -0 on this - seems like it'd be noisy and only helps developers who'd be in a position to do it the right way instead.

@acdha , it would be behind a log level setting. So you'd say, Raven.config(..., {level: 'warn'}) so you can control how much noise you want.

I wouldn't object to you adding it but I do wonder whether it would just encourage people to send poorly crafted log messages rather than integrate logging correctly.

usually when you do a Raven.captureMessage or captureException, you could put a console.log there if you like, or write a small wrapper for yourself, would be like two lines of code for the developer.

Edit: Really the developer should be wrapping calls to Raven.capture* anyways, otherwise you're really coupling yourself to the Raven implementation.

This is done with the console plugin.

Was this page helpful?
0 / 5 - 0 ratings