aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-22 11:28:58 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-22 11:28:58 +0000
commit3835f6ab25053a64d9bac63bda5d3b62a242f91a (patch)
treea47eceab9c27958e4400746d687016c320783cfb
parentd76439239dc7b8870afef34afccfedcd1ffd7ad0 (diff)
downloadrails-3835f6ab25053a64d9bac63bda5d3b62a242f91a.tar.gz
rails-3835f6ab25053a64d9bac63bda5d3b62a242f91a.tar.bz2
rails-3835f6ab25053a64d9bac63bda5d3b62a242f91a.zip
Changed caching/expiration/hit to report using the DEBUG log level and errors to use the ERROR log level instead of both using INFO
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1889 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/caching.rb18
-rw-r--r--actionpack/lib/action_view/base.rb6
3 files changed, 14 insertions, 12 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index b88434e45d..860c35b768 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Changed caching/expiration/hit to report using the DEBUG log level and errors to use the ERROR log level instead of both using INFO
+
* Added support for per-action session management #1763
* Improved rendering speed on complicated templates by up to 25% #1234 [Stephan Kaes]. This did necessasitate a change to the internals of ActionView#render_template that now has four parameters. Developers of custom view handlers (like Amrita) need to update for that.
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb
index 0868e896b7..bad397c2a8 100644
--- a/actionpack/lib/action_controller/caching.rb
+++ b/actionpack/lib/action_controller/caching.rb
@@ -75,7 +75,7 @@ module ActionController #:nodoc:
def expire_page(path)
return unless perform_caching
File.delete(page_cache_path(path)) if File.exists?(page_cache_path(path))
- logger.info "Expired page: #{page_cache_file(path)}" unless logger.nil?
+ logger.debug "Expired page: #{page_cache_file(path)}" unless logger.nil?
end
# Manually cache the +content+ in the key determined by +path+. Example:
@@ -84,7 +84,7 @@ module ActionController #:nodoc:
return unless perform_caching
FileUtils.makedirs(File.dirname(page_cache_path(path)))
File.open(page_cache_path(path), "w+") { |f| f.write(content) }
- logger.info "Cached page: #{page_cache_file(path)}" unless logger.nil?
+ logger.debug "Cached page: #{page_cache_file(path)}" unless logger.nil?
end
# Caches the +actions+ using the page-caching approach that'll store the cache in a path within the page_cache_directory that
@@ -280,7 +280,7 @@ module ActionController #:nodoc:
key = fragment_cache_key(name)
fragment_cache_store.write(key, content, options)
- logger.info "Cached fragment: #{key}" unless logger.nil?
+ logger.debug "Cached fragment: #{key}" unless logger.nil?
content
end
@@ -289,7 +289,7 @@ module ActionController #:nodoc:
key = fragment_cache_key(name)
if cache = fragment_cache_store.read(key, options)
- logger.info "Fragment hit: #{key}" unless logger.nil?
+ logger.debug "Fragment hit: #{key}" unless logger.nil?
cache
else
false
@@ -307,10 +307,10 @@ module ActionController #:nodoc:
if key.is_a?(Regexp)
fragment_cache_store.delete_matched(key, options)
- logger.info "Expired fragments matching: #{key.source}" unless logger.nil?
+ logger.debug "Expired fragments matching: #{key.source}" unless logger.nil?
else
fragment_cache_store.delete(key, options)
- logger.info "Expired fragment: #{key}" unless logger.nil?
+ logger.debug "Expired fragment: #{key}" unless logger.nil?
end
end
@@ -362,7 +362,7 @@ module ActionController #:nodoc:
ensure_cache_path(File.dirname(real_file_path(name)))
File.open(real_file_path(name), "w+") { |f| f.write(value) }
rescue => e
- Base.logger.info "Couldn't create cache directory: #{name} (#{e.message})" unless Base.logger.nil?
+ Base.logger.error "Couldn't create cache directory: #{name} (#{e.message})" unless Base.logger.nil?
end
def read(name, options = {}) #:nodoc:
@@ -372,7 +372,7 @@ module ActionController #:nodoc:
def delete(name, options) #:nodoc:
File.delete(real_file_path(name))
rescue SystemCallError => e
- Base.logger.info "Couldn't expire cache #{name} (#{e.message})" unless Base.logger.nil?
+ Base.logger.error "Couldn't expire cache #{name} (#{e.message})" unless Base.logger.nil?
end
def delete_matched(matcher, options) #:nodoc:
@@ -381,7 +381,7 @@ module ActionController #:nodoc:
begin
File.delete(f)
rescue Object => e
- Base.logger.info "Couldn't expire cache: #{f} (#{e.message})" unless Base.logger.nil?
+ Base.logger.error "Couldn't expire cache: #{f} (#{e.message})" unless Base.logger.nil?
end
end
end
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 15f1ea739c..6ffdd55a7e 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -323,8 +323,8 @@ module ActionView #:nodoc:
def rhtml_render(extension, template, file_name, local_assigns)
render_sym = compile_erb_template(template, file_name)
saved_locals = evaluate_assigns(local_assigns)
- result = self.send render_sym
- saved_locals.each{|k,v| instance_variable_set k,v }
+ result = self.send(render_sym)
+ saved_locals.each { |k,v| instance_variable_set(k, v) }
result
end
@@ -333,7 +333,7 @@ module ActionView #:nodoc:
saved_locals = evaluate_assigns(local_assigns)
xml = Builder::XmlMarkup.new(:indent => 2)
result = eval(template, binding, '(template)(eval)', 1)
- saved_locals.each{|k,v| instance_variable_set k,v }
+ saved_locals.each { |k,v| instance_variable_set(k,v) }
result
end