Skip to content

Instantly share code, notes, and snippets.

@genki
Created February 20, 2009 16:15
Show Gist options
  • Save genki/67536 to your computer and use it in GitHub Desktop.
Save genki/67536 to your computer and use it in GitHub Desktop.
class LoggingMemcachedStore < Merb::Cache::MemcachedStore
include Extlib::Hook
before :read do |key, params|
if exists?(key, params)
Merb.logger.debug "Cache Hit: #{key}"
else
Merb.logger.debug "Cache Miss: #{key}"
end
end
before :write do |key, data, params, conds|
Merb.logger.debug "Cache Write: #{key}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment