Sha256: 64d22cc44e4cfafc885e280629e839b1513a702b853e2212e646ee5d88b03009
Contents?: true
Size: 637 Bytes
Versions: 17
Compression:
Stored size: 637 Bytes
Contents
# frozen_string_literal: true require 'active_support/log_subscriber' module Cased module Instrumentation class LogSubscriber < ActiveSupport::LogSubscriber def self.events=(value) Thread.current['cased_events'] = value end def self.events Thread.current['cased_events'] ||= 0 end def self.reset_events self.events = 0 end def audit_event(event) self.class.events += 1 event = JSON.generate(event.payload[:event]) name = color('Cased', CYAN, true) debug " #{name} #{event}" end attach_to :cased end end end
Version data entries
17 entries across 17 versions & 1 rubygems