<commit_before>require 'logger' # Require the standard Ruby Logger
require 'redis' rescue nil

module Rack::Insight
  class Config

    VERBOSITY = {
      :debug => Logger::DEBUG,
      :high => Logger::INFO,
      :med => Logger::WARN,
      :low => Logger::ERROR,
      # Silent can be used with unless instead of if.  Example:
      #   logger.info("some message") unless app.verbose(:silent)
      :silent => Logger::FATAL
    }

    class << self
      attr_reader :config, :verbosity, :log_file, :log_level, :rails_log_copy,
                  :filtered_backtrace, :panel_configs, :silence_magic_insight_warnings,
                  :database, :handle_javascript
    end
    @log_file = STDOUT
    @log_level = ::Logger::DEBUG
    @logger = nil
    @verbosity = nil
    @rails_log_copy = true
    @filtered_backtrace = true
    @panel_configs = {
      :active_record => {:probes => {'ActiveRecord::Base' => [:class, :allocate]}},
      :active_resource => {:probes => {'ActiveResource::Connection' => [:instance, :request]}},
      :cache => {:probes => { 'Memcached'     => [:instance, :decrement, :get, :increment, :set,
                                                                 :add, :replace, :delete, :prepend, :append],
                              'MemCache'      => [:instance, :decr, :get, :get_multi, :incr, :set, :add, :delete],
                              'Dalli::Client' => [:instance, :perform] } },
#      :log_panel => The log panel configures its probes in its initializer
      :sphinx => {:probes => {'Riddle::Client' => [:instance, :request]}},
      :sql => {:probes => Hash[%w{ PostgreSQLAdapter MysqlAdapter SQLiteAdapter
                  Mysql2Adapter OracleEnhancedAdapter }.map do |adapter|
                    ["ActiveRecord::ConnectionAdapters::#{adapter}", [:instance, :execute, :exec_query]]
                  end ] },<commit_msg>fix: handle Sphinx::Integration::Extensions::Riddle::Client instance request<commit_after>require 'logger' # Require the standard Ruby Logger
require 'redis' rescue nil

module Rack::Insight
  class Config

    VERBOSITY = {
      :debug => Logger::DEBUG,
      :high => Logger::INFO,
      :med => Logger::WARN,
      :low => Logger::ERROR,
      # Silent can be used with unless instead of if.  Example:
      #   logger.info("some message") unless app.verbose(:silent)
      :silent => Logger::FATAL
    }

    class << self
      attr_reader :config, :verbosity, :log_file, :log_level, :rails_log_copy,
                  :filtered_backtrace, :panel_configs, :silence_magic_insight_warnings,
                  :database, :handle_javascript
    end
    @log_file = STDOUT
    @log_level = ::Logger::DEBUG
    @logger = nil
    @verbosity = nil
    @rails_log_copy = true
    @filtered_backtrace = true
    @panel_configs = {
      :active_record => {:probes => {'ActiveRecord::Base' => [:class, :allocate]}},
      :active_resource => {:probes => {'ActiveResource::Connection' => [:instance, :request]}},
      :cache => {:probes => { 'Memcached'     => [:instance, :decrement, :get, :increment, :set,
                                                                 :add, :replace, :delete, :prepend, :append],
                              'MemCache'      => [:instance, :decr, :get, :get_multi, :incr, :set, :add, :delete],
                              'Dalli::Client' => [:instance, :perform] } },
#      :log_panel => The log panel configures its probes in its initializer
      :sphinx => {:probes => {'Riddle::Client' => [:instance, :request],
                              'Sphinx::Integration::Extensions::Riddle::Client' => [:instance, :request]}},
      :sql => {:probes => Hash[%w{ PostgreSQLAdapter MysqlAdapter SQLiteAdapter
                  Mysql2Adapter OracleEnhancedAdapter }.map do |adapter|
                    ["ActiveRecord::ConnectionAdapters::#{adapter}", [:instance, :execute, :exec_query]]
                  end ] },
{'fraction_non_alphanumeric': 0.1450420596482284, 'fraction_numerical': 0.0005098139179199592, 'mean_word_length': 2.506702412868633, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2457450', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1133, 'n_words': 273}