Sha256: e7e829e2136a31d9b0b6e47ba6d83ae4ccba71e154163545e24f6903a7a5aaf8

Contents?: true

Size: 496 Bytes

Versions: 6

Compression:

Stored size: 496 Bytes

Contents

# frozen_string_literal: true

module SecondLevelCache
  class LogSubscriber < ActiveSupport::LogSubscriber
    # preload.second_level_cache
    def preload(event)
      prefix = color("SecondLevelCache", CYAN)
      miss_ids = (event.payload[:miss] || []).join(",")
      hit_ids = (event.payload[:hit] || []).join(",")
      debug "  #{prefix} preload #{event.payload[:key]} miss [#{miss_ids}], hit [#{hit_ids}]"
    end
  end
end

SecondLevelCache::LogSubscriber.attach_to :second_level_cache

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
second_level_cache-2.7.1 lib/second_level_cache/log_subscriber.rb
second_level_cache-2.7.0 lib/second_level_cache/log_subscriber.rb
second_level_cache-2.6.4 lib/second_level_cache/log_subscriber.rb
second_level_cache-2.6.3 lib/second_level_cache/log_subscriber.rb
second_level_cache-2.6.2 lib/second_level_cache/log_subscriber.rb
second_level_cache-2.6.1 lib/second_level_cache/log_subscriber.rb