lib/wasserstand/heap_cache.rb in wasserstand-0.0.9 vs lib/wasserstand/heap_cache.rb in wasserstand-0.0.10
- old
+ new
@@ -1,16 +1,18 @@
-class HeapCache
- def initialize
- @backend = {}
- end
+module Wasserstand
+ class HeapCache
+ def initialize
+ @backend = {}
+ end
- def get(name)
- result = @backend[name]
- STDERR.puts "#{self.class.name} GET #{result ? 'HIT' : 'MISS'} #{name}"
- result
- end
+ def get(name)
+ result = @backend[name]
+ Wasserstand.logger.debug "#{self.class.name} GET #{result ? 'HIT' : 'MISS'} #{name}"
+ result
+ end
- def set(name, value)
- STDERR.puts "#{self.class.name} SET #{name} => #{value.inspect}"
- @backend[name] = value
+ def set(name, value)
+ Wasserstand.logger.debug "#{self.class.name} SET #{name} => #{value.inspect}"
+ @backend[name] = value
+ end
end
end