Class: ActionView::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- ActionView::LogSubscriber
- 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
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
-
#logger ⇒ Object
TODO: Ideally, ActionView should have its own logger so it does not depend on AC.logger.
- #render_template(event) ⇒ Object (also: #render_partial, #render_collection)
Methods inherited from ActiveSupport::LogSubscriber
attach_to, #call, flush_all!, flushable_loggers, log_subscribers, logger
Instance Method Details
#logger ⇒ Object
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) = " Rendered #{from_rails_root(event.payload[:identifier])}" << " within #{from_rails_root(event.payload[:layout])}" if event.payload[:layout] << (" (%.1fms)" % event.duration) info() end |