Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
require 'securerandom'
require 'active_support/notifications'
require 'active_support/log_subscriber'
module Cassanity
module Instrumentation
class LogSubscriber < ::ActiveSupport::LogSubscriber
def cql(event)
return unless logger.debug?
name = '%s (%.1fms)' % ["CQL Query", event.duration]
cql = event.payload[:cql]
vars = event.payload[:cql_variables] || []
variables = vars.map { |var| var.inspect }.join(', ')
query = "#{cql}"
query += " (#{variables})" unless variables.empty?
debug " #{color(name, CYAN, true)} [ #{query} ]"
end
end
end
end
Cassanity::Instrumentation::LogSubscriber.attach_to :cassanity