Financial-Times / o-errors

Decoupled client-side error-logging
http://registry.origami.ft.com/components/o-errors
1 stars 2 forks source link

Config setting for logging errors to the browser's console #110

Closed jamesnicholls closed 3 years ago

jamesnicholls commented 3 years ago

What

Implement a configuration setting (or extend the logLevel setting) that, when switched on/off, logs errors to the console instead of sending them to Sentry.

Details

The US Growth team recently implemented o-errors into an application. During development and testing, we wanted to see the errors logged to the browser's console rather than sending errors to Sentry. We thought setting the logLevel to consoleonly would achieve this. While this setting does prevent errors being sent to Sentry, the errors aren't logged to the console (the setting replaces the raven methods with no-ops).

Other values for the logLevel setting only affect o-errors logging methods, which makes the logLevel setting a little inconsistent and confusing to use.

I suggest either:

Additional information

I've spoken to @JakeChampion about this already: https://financialtimes.slack.com/archives/C02FU5ARJ/p1610984259006200.

I'm also happy to submit a PR to implement this feature but I would appreciate some guidance on which of the two options above you think would be better.

JakeChampion commented 3 years ago

Thank you for opening this issue @jamesnicholls

I suggest either:

* amending the `consoleonly` `logLevel` setting so that it also logs errors to the console, or;

This is the option I would go with 👍

I'm happy to review any pull-requests for this feature :-)

JakeChampion commented 3 years ago

this was done in https://github.com/Financial-Times/o-errors/pull/118