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

Idea: Passing lambda to tags_context and extra_context #131

Closed
gogiel opened this issue Sep 19, 2013 · 4 comments
Closed

Idea: Passing lambda to tags_context and extra_context #131

gogiel opened this issue Sep 19, 2013 · 4 comments

Comments

@gogiel
Copy link

gogiel commented Sep 19, 2013

It would be nice to have a possibility to pass lambda to tags_context and extra_context to extract some information in runtime.
I think of two scenarios:

  • passing lambda that returns Hash instance
  • passing lambdas as Hash keys and calling them at runtime
@nateberkopec
Copy link
Contributor

Hmmm, I'm having trouble of thinking of a scenario when this would actually be useful. When would you need to do this?

@phillbaker
Copy link
Contributor

I was going to open an issue similar to this about a month ago, but subscribed to this issue instead 😀.

Just a couple of scenarios: you can attach tags by section of the application (ie customer-facing or admin-facing depending on the controller) or tags by type of error (maybe grouping the errors). Specifically, one common use case we have is grouping all network-related errors and separating them from application-level errors.

@nateberkopec
Copy link
Contributor

Not a lot of action here, so we won't be implementing this. PRs welcome. Somewhat related to #479.

@ndbroadbent
Copy link

I just had this idea as well. My code currently runs a SQL query to add information about the user and their organization to the user_context. It would be great if I could set a lambda so that the SQL query only runs when there's actually an error. (Otherwise it runs on every single request.)

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

No branches or pull requests

4 participants