Class: ActionView::LogSubscriber

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/action_view/log_subscriber.rb

Overview

Action View Log Subscriber

Provides functionality so that Rails can output logs from Action View.

Instance Method Summary collapse

Instance Method Details

#loggerObject

TODO: Ideally, ActionView should have its own logger so it does not depend on AC.logger



16
17
18
# File 'lib/action_view/log_subscriber.rb', line 16

def logger
  ActionController::Base.logger if defined?(ActionController::Base)
end

#render_template(event) ⇒ Object Also known as: render_partial, render_collection



6
7
8
9
10
11
# File 'lib/action_view/log_subscriber.rb', line 6

def render_template(event)
  message = "  Rendered #{from_rails_root(event.payload[:identifier])}"
  message << " within #{from_rails_root(event.payload[:layout])}" if event.payload[:layout]
  message << (" (%.1fms)" % event.duration)
  info(message)
end