<commit_before>module Tire

  class Configuration

    def self.url(value=nil)
      @url = (value ? value.to_s.gsub(%r|/*$|, '') : nil) || @url || ENV['ELASTICSEARCH_URL'] || "http://localhost:9200"
    end

    def self.client(klass=nil)
      @client = klass || @client || HTTP::Client::RestClient
    end

    def self.wrapper(klass=nil)
      @wrapper = klass || @wrapper || Results::Item
    end

    def self.logger(device=nil, options={})
      return @logger = Logger.new(device, options) if device
      if !@warned
        STDOUT.puts "WARNING: No ElasticSearch logger defined, only errors will be logged to STDERR, no info logging"
        @warned = true
      end
      @logger || nil
    end

    def self.pretty(value=nil, options={})
      if value === false<commit_msg>#TC-2219: don't log warning when logger is actually set :)<commit_after>module Tire

  class Configuration

    def self.url(value=nil)
      @url = (value ? value.to_s.gsub(%r|/*$|, '') : nil) || @url || ENV['ELASTICSEARCH_URL'] || "http://localhost:9200"
    end

    def self.client(klass=nil)
      @client = klass || @client || HTTP::Client::RestClient
    end

    def self.wrapper(klass=nil)
      @wrapper = klass || @wrapper || Results::Item
    end

    def self.logger(device=nil, options={})
      return @logger = Logger.new(device, options) if device
      if !@logger && !@warned
        STDOUT.puts "WARNING: No ElasticSearch logger defined, only errors will be logged to STDERR, no info logging"
        @warned = true
      end
      @logger || nil
    end

    def self.pretty(value=nil, options={})
      if value === false
{'fraction_non_alphanumeric': 0.13996316758747698, 'fraction_numerical': 0.007366482504604052, 'mean_word_length': 2.8902147971360383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3275984', 'n_tokens_mistral': 531, 'n_tokens_neox': 515, 'n_words': 143}