Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Allow setting (some) options after initial Raven.config call #213

Closed
bregenspan opened this issue May 20, 2014 · 3 comments · Fixed by #219
Closed

Feature Request: Allow setting (some) options after initial Raven.config call #213

bregenspan opened this issue May 20, 2014 · 3 comments · Fixed by #219

Comments

@bregenspan
Copy link

Currently Raven expects to be configured once, and further configuration requires resubmitting the full config object + DSN.

Setting some config values after initial config can be useful in some cases. For example, tagging all events submitted by a logged-in user as such, which happens to be the use case I'm interested in. That looks like:

  1. Load and configure Raven
  2. Wait for user login status
  3. If user is logged in, do Raven.setUser (works already) and also set "tags" option (doesn't work already)

Here's how I implemented this in a fork - just as a simple setter: gawkermedia/raven-js@getsentry:master...master . If this is something you'd consider for inclusion in master, I can document it and send a PR.

@DouweM
Copy link
Contributor

DouweM commented Jun 25, 2014

In line with the setUser method, I'd go with setExtra and setTags. Otherwise, 👍 on the feature!

@mattrobenolt
Copy link
Contributor

Oh, somehow I completely missed this.

Yeah, I'm on board with this idea. I assume you'd need some more robust management to set/unset things if the state were to change. It's a bit simpler with setUser, but I'm open to seeing an implementation. :)

@bregenspan
Copy link
Author

@DouweM awesome, thanks for adding that! Better interface than a more general setter for sure.

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

Successfully merging a pull request may close this issue.

3 participants