<commit_before>require "insist"
require "logstash/agent"
require "logstash/event"
require "insist"
require "stud/try"

$TESTING = true
if RUBY_VERSION < "1.9.2"
  $stderr.puts "Ruby 1.9.2 or later is required. (You are running: " + RUBY_VERSION + ")"
  $stderr.puts "Options for fixing this: "
  $stderr.puts "  * If doing 'ruby bin/logstash ...' add --1.9 flag to 'ruby'"
  $stderr.puts "  * If doing 'java -jar ... ' add -Djruby.compat.version=RUBY1_9 to java flags"
  raise LoadError
end

module LogStash
  module RSpec
    def config(configstr)
      @config_str = configstr
    end # def config

    def config_yaml(configstr)
      @config_str = configstr
      @is_yaml = true
    end

    def type(default_type)
      @default_type = default_type<commit_msg>Make a way to enable debugg logs<commit_after>require "insist"
require "logstash/agent"
require "logstash/event"
require "insist"
require "stud/try"

$TESTING = true
if RUBY_VERSION < "1.9.2"
  $stderr.puts "Ruby 1.9.2 or later is required. (You are running: " + RUBY_VERSION + ")"
  $stderr.puts "Options for fixing this: "
  $stderr.puts "  * If doing 'ruby bin/logstash ...' add --1.9 flag to 'ruby'"
  $stderr.puts "  * If doing 'java -jar ... ' add -Djruby.compat.version=RUBY1_9 to java flags"
  raise LoadError
end

if ENV["TEST_DEBUG"]
  Cabin::Channel.get.level = :debug 
  Cabin::Channel.get.subscribe(STDOUT)
end

module LogStash
  module RSpec
    def config(configstr)
      @config_str = configstr
    end # def config

    def config_yaml(configstr)
      @config_str = configstr
      @is_yaml = true
    end

    def type(default_type)
      @default_type = default_type
{'fraction_non_alphanumeric': 0.1161524500907441, 'fraction_numerical': 0.012099213551119177, 'mean_word_length': 3.2628865979381443, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4075281', 'n_tokens_mistral': 611, 'n_tokens_neox': 586, 'n_words': 163}