diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-18 09:53:14 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-18 09:53:14 -0800 |
commit | b70236cfcb569c4560330b46f5c5ce76593e3225 (patch) | |
tree | 1d0d45a226ec2001edf7966435adcd48872d6cf0 /actionpack/lib | |
parent | e1540897101b710f4cf06cbe971ba04e59c4fb71 (diff) | |
parent | 5a6ea535145270751bdf712a6e5c489650765ca7 (diff) | |
download | rails-b70236cfcb569c4560330b46f5c5ce76593e3225.tar.gz rails-b70236cfcb569c4560330b46f5c5ce76593e3225.tar.bz2 rails-b70236cfcb569c4560330b46f5c5ce76593e3225.zip |
Merge pull request #4523 from rafaelfranca/av-logger
Add ActionView own logger
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_view/log_subscriber.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_view/railtie.rb | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 0b026882ae..122dc9db7f 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -143,6 +143,7 @@ module ActionView #:nodoc: class_attribute :helpers class_attribute :_routes + class_attribute :logger class << self delegate :erb_trim_mode=, :to => 'ActionView::Template::Handlers::ERB' diff --git a/actionpack/lib/action_view/log_subscriber.rb b/actionpack/lib/action_view/log_subscriber.rb index bf90d012bf..cc3a871576 100644 --- a/actionpack/lib/action_view/log_subscriber.rb +++ b/actionpack/lib/action_view/log_subscriber.rb @@ -12,9 +12,8 @@ module ActionView alias :render_partial :render_template alias :render_collection :render_template - # TODO: Ideally, ActionView should have its own logger so it does not depend on AC.logger def logger - ActionController::Base.logger if defined?(ActionController::Base) + ActionView::Base.logger end protected diff --git a/actionpack/lib/action_view/railtie.rb b/actionpack/lib/action_view/railtie.rb index 80391d72cc..43371a1c49 100644 --- a/actionpack/lib/action_view/railtie.rb +++ b/actionpack/lib/action_view/railtie.rb @@ -8,6 +8,10 @@ module ActionView config.action_view.stylesheet_expansions = {} config.action_view.javascript_expansions = { :defaults => %w(jquery jquery_ujs) } + initializer "action_view.logger" do + ActiveSupport.on_load(:action_view) { self.logger ||= Rails.logger } + end + initializer "action_view.cache_asset_ids" do |app| unless app.config.cache_classes ActiveSupport.on_load(:action_view) do |