aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-10-07 11:17:50 -0300
committerJosé Valim <jose.valim@gmail.com>2009-10-15 18:18:44 -0300
commitaf0d1fa8920793a95fae456d1f5debdc50287eb3 (patch)
treedfae586337161abfa8567bf085bdb2e68a070cc2 /activesupport/lib/active_support/cache.rb
parent5d0f8abc003cc6edfdb471ada05754580725b353 (diff)
downloadrails-af0d1fa8920793a95fae456d1f5debdc50287eb3.tar.gz
rails-af0d1fa8920793a95fae456d1f5debdc50287eb3.tar.bz2
rails-af0d1fa8920793a95fae456d1f5debdc50287eb3.zip
Update Orchestra instrumentations and move part of logging to Orchestra.
Diffstat (limited to 'activesupport/lib/active_support/cache.rb')
-rw-r--r--activesupport/lib/active_support/cache.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb
index a415686020..dfd53462af 100644
--- a/activesupport/lib/active_support/cache.rb
+++ b/activesupport/lib/active_support/cache.rb
@@ -219,7 +219,6 @@ module ActiveSupport
end
def increment(key, amount = 1)
- log("incrementing", key, amount)
if num = read(key)
write(key, num + amount)
else
@@ -228,7 +227,6 @@ module ActiveSupport
end
def decrement(key, amount = 1)
- log("decrementing", key, amount)
if num = read(key)
write(key, num - amount)
else
@@ -247,13 +245,14 @@ module ActiveSupport
payload = { :key => key }
payload.merge!(options) if options.is_a?(Hash)
- event = ActiveSupport::Orchestra.instrument(:"cache_#{operation}", payload, &block)
- log("#{operation} (%.1fms)" % event.duration, key, options)
- event.result
+ # Cache events should be logged or not?
+ # log(operation, key, options)
+ ActiveSupport::Orchestra.instrument(:"cache_#{operation}", payload, &block)
end
def log(operation, key, options)
- logger.debug("Cache #{operation}: #{key}#{options ? " (#{options.inspect})" : ""}") if logger && !silence?
+ return unless logger && !silence?
+ logger.debug("Cache #{operation}: #{key}#{options ? " (#{options.inspect})" : ""}")
end
end
end