diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-08-18 22:38:58 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-08-18 23:36:13 -0500 |
commit | c1a8690d582c08777055caf449c03f85b4c8aa4b (patch) | |
tree | aa88127d58845658f32fb9284b0f837f13700800 /actionpack | |
parent | a4da8175a2c989104de1a38e43d5ddfb0f89b055 (diff) | |
download | rails-c1a8690d582c08777055caf449c03f85b4c8aa4b.tar.gz rails-c1a8690d582c08777055caf449c03f85b4c8aa4b.tar.bz2 rails-c1a8690d582c08777055caf449c03f85b4c8aa4b.zip |
Consistently use the framework's configured logger and avoid reverting to RAILS_DEFAULT_LOGGER unless necessary.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/dispatcher.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_view/base.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_view/paths.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/renderable.rb | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/dispatcher.rb b/actionpack/lib/action_controller/dispatcher.rb index 835d8e834e..7e46f572fe 100644 --- a/actionpack/lib/action_controller/dispatcher.rb +++ b/actionpack/lib/action_controller/dispatcher.rb @@ -24,7 +24,7 @@ module ActionController to_prepare(:activerecord_instantiate_observers) { ActiveRecord::Base.instantiate_observers } end - after_dispatch :flush_logger if defined?(RAILS_DEFAULT_LOGGER) && RAILS_DEFAULT_LOGGER.respond_to?(:flush) + after_dispatch :flush_logger if Base.logger && Base.logger.respond_to?(:flush) end # Backward-compatible class method takes CGI-specific args. Deprecated @@ -142,7 +142,7 @@ module ActionController end def flush_logger - RAILS_DEFAULT_LOGGER.flush + Base.logger.flush end protected diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index f7f9f70298..62a01b33dd 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -169,6 +169,7 @@ module ActionView #:nodoc: class << self delegate :erb_trim_mode=, :to => 'ActionView::TemplateHandlers::ERB' + delegate :logger, :to => 'ActionController::Base' end def self.cache_template_loading=(*args) @@ -328,7 +329,7 @@ module ActionView #:nodoc: else template = Template.new(template_path, view_paths) - if self.class.warn_cache_misses && logger = ActionController::Base.logger + if self.class.warn_cache_misses && logger logger.debug "[PERFORMANCE] Rendering a template that was " + "not found in view path. Templates outside the view path are " + "not cached and result in expensive disk operations. Move this " + diff --git a/actionpack/lib/action_view/paths.rb b/actionpack/lib/action_view/paths.rb index d97f963540..6a118a1cfa 100644 --- a/actionpack/lib/action_view/paths.rb +++ b/actionpack/lib/action_view/paths.rb @@ -3,7 +3,7 @@ module ActionView #:nodoc: def self.type_cast(obj) if obj.is_a?(String) if Base.warn_cache_misses && defined?(Rails) && Rails.initialized? - Rails.logger.debug "[PERFORMANCE] Processing view path during a " + + Base.logger.debug "[PERFORMANCE] Processing view path during a " + "request. This an expense disk operation that should be done at " + "boot. You can manually process this view path with " + "ActionView::Base.process_view_paths(#{obj.inspect}) and set it " + diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb index a28689dc69..c011f21550 100644 --- a/actionpack/lib/action_view/renderable.rb +++ b/actionpack/lib/action_view/renderable.rb @@ -72,7 +72,7 @@ module ActionView end_src begin - logger = ActionController::Base.logger + logger = Base.logger logger.debug "Compiling template #{render_symbol}" if logger ActionView::Base::CompiledTemplates.module_eval(source, filename, 0) |