mirror of https://github.com/rails/rails
Add silenced? for Action View Start subscriber
Previously, the `render_template.action_view` and `render_layout.action_view` events would always be handled as if they had subscribers even if the log level of its subscribers result in nothing being logged. For regular `LogSubscriber`s, `subscribe_log_level` could be used to optimize these cases but the Start subscriber is not a subclass of `LogSubscriber`. This commit implements a `#subscribed?` method for the Start subscriber so that it can also benefit from the `subscribe_log_level` optimization.
This commit is contained in:
parent
4fb230d214
commit
d255ffd035
|
@ -96,6 +96,10 @@ module ActionView
|
|||
|
||||
def finish(name, id, payload)
|
||||
end
|
||||
|
||||
def silenced?(_)
|
||||
logger.nil? || !logger.debug?
|
||||
end
|
||||
end
|
||||
|
||||
def self.attach_to(*)
|
||||
|
|
Loading…
Reference in New Issue