Methods
Constants
| LOG_LEVELS | = | [:debug, :info, :warn, :error].freeze |
Attributes
| [W] | logger | |
| [RW] | namespace |
Class Public methods
default_logger() Link
event_log_level(method_name, level, if: nil) Link
Sets the level an event is logged at. With if, the event is only logged while the condition returns true.
event_log_level :fragment_cache, :info, if: -> { ActionController::Base.enable_fragment_cache_logging }
# File activesupport/lib/active_support/event_reporter/log_subscriber.rb, line 35 def event_log_level(method_name, level, if: nil) self.log_levels = log_levels.merge(method_name.to_s => level).freeze condition = binding.local_variable_get(:if) self.log_conditions = ActiveSupport::Ractors.try_make_shareable(log_conditions.merge(method_name.to_s => condition)).freeze end
logger() Link
subscription_filter() Link
Instance Public methods
consumes?(name) Link
Whether an event with this name would currently be logged, so that the event reporter can skip building events this subscriber would discard. Deliberately not memoized: the answer changes with the logger’s level.