Source: show | on GitHub
# File activesupport/lib/active_support/event_reporter/log_subscriber.rb, line 22 def default_logger raise NotImplementedError end
# File activesupport/lib/active_support/event_reporter/log_subscriber.rb, line 14 def event_log_level(method_name, level) self.log_levels = log_levels.merge(method_name.to_s => level).freeze end
# File activesupport/lib/active_support/event_reporter/log_subscriber.rb, line 18 def logger @logger || default_logger end
# File activesupport/lib/active_support/event_reporter/log_subscriber.rb, line 29 def subscription_filter prefix = "#{namespace}.".freeze proc do |event| event[:name].start_with?(prefix) end end
# File activesupport/lib/active_support/event_reporter/log_subscriber.rb, line 39 def emit(event) return unless logger name = event[:name] event_method = name[name.index(".") + 1, name.length] public_send(event_method, event) if log_level_satisfied?(event_method) end
# File activesupport/lib/active_support/event_reporter/log_subscriber.rb, line 47 def logger self.class.logger end