Class: ActionView::LogSubscriber

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

Overview

Action View Log Subscriber

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

Constant Summary

Constant Summary

Constants inherited from ActiveSupport::LogSubscriber

ActiveSupport::LogSubscriber::BLACK, ActiveSupport::LogSubscriber::BLUE, ActiveSupport::LogSubscriber::BOLD, ActiveSupport::LogSubscriber::CLEAR, ActiveSupport::LogSubscriber::CYAN, ActiveSupport::LogSubscriber::GREEN, ActiveSupport::LogSubscriber::MAGENTA, ActiveSupport::LogSubscriber::RED, ActiveSupport::LogSubscriber::WHITE, ActiveSupport::LogSubscriber::YELLOW

Instance Method Summary collapse

Methods inherited from ActiveSupport::LogSubscriber

attach_to, #call, flush_all!, flushable_loggers, log_subscribers, logger

Instance Method Details

#loggerObject

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



16
17
18
# File 'actionpack/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 'actionpack/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