Repository navigation
Enable debug mode for events in local environments - #55566
Merged
Merged
Conversation
|
|
||
| self.context_store = EventContext | ||
|
|
||
| def initialize(*subscribers, raise_on_error: false, tags: nil) |
Contributor
Author
There was a problem hiding this comment.
tags was unused
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / Background
Emit debug events by default in local environments. It would be good for devs to be able to see debug events when working locally, and it's also a bit of a pain to have to wrap tests in
Rails.event.with_debugany time we want to assert that a debug event was emitted.Detail
Sets a new option on the Event Reporter,
debug_mode, which will force the event reporter into debug mode. When bootstrapping the app, we configure that value based onconfig.consider_all_requests_local.Also two small cleanups -- removed an unused
tagskwarg from the constructor, and ensured#notifyreturnsnil.Additional information
I considered combining
debug_modewithraise_on_error, but decided it was clearer to keep them separate. We set both of them for local requests, but they don't mean the same thing. The former is enabling the emission of all debug events, and the latter defines behaviour if we encounter an error during event emission / in the subscriber code.I've also opted to no'doc
debug_mode, I don't think apps should set this directly.Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]