diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/cache.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index 57c6a6331d..5a064f8bea 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -36,7 +36,6 @@ module ActiveSupport expanded_cache_key end - class Store cattr_accessor :logger @@ -44,6 +43,11 @@ module ActiveSupport extend ThreadSafety end + def silence! + @silence = true + self + end + # Pass <tt>:force => true</tt> to force a cache miss. def fetch(key, options = {}) @logger_off = true @@ -108,7 +112,7 @@ module ActiveSupport private def log(operation, key, options) - logger.debug("Cache #{operation}: #{key}#{options ? " (#{options.inspect})" : ""}") if logger && !@logger_off + logger.debug("Cache #{operation}: #{key}#{options ? " (#{options.inspect})" : ""}") if logger && !@silence && !@logger_off end end |