<commit_before>require 'time'
require 'bunny'
require 'logger'
require "event/version"
require 'event/broker_handler'
require 'event/message_producer'
require 'event/message_consumer'
require 'event/listener'
require 'json'
require 'fileutils'

module Event
  extend self
  require 'event/railtie' if defined?(Rails)

  @listeners ||= {}

  def bootstrap(config)
    @configuration = config
    log_filename = "log/#{config[:base_routing_key]}_event_producer.log"
    ensure_file_exists(log_filename)
    @logger = Logger.new(log_filename)
    @logger.level = Logger::INFO
  end

  def listen_events!
    Thread.new do
      log_filename = "log/#{config[:base_routing_key]}_event_consumer.log"
      ensure_file_exists(log_filename)
      logger = Logger.new(log_filename)<commit_msg>fix consumer log name<commit_after>require 'time'
require 'bunny'
require 'logger'
require "event/version"
require 'event/broker_handler'
require 'event/message_producer'
require 'event/message_consumer'
require 'event/listener'
require 'json'
require 'fileutils'

module Event
  extend self
  require 'event/railtie' if defined?(Rails)

  @listeners ||= {}

  def bootstrap(config)
    @configuration = config
    log_filename = "log/#{config[:base_routing_key]}_event_producer.log"
    ensure_file_exists(log_filename)
    @logger = Logger.new(log_filename)
    @logger.level = Logger::INFO
  end

  def listen_events!
    Thread.new do
      log_filename = "log/#{@configuration[:base_routing_key]}_event_consumer.log"
      ensure_file_exists(log_filename)
      logger = Logger.new(log_filename)
{'fraction_non_alphanumeric': 0.10921717171717171, 'fraction_numerical': 0.0, 'mean_word_length': 5.049618320610687, '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': '561315', 'n_tokens_mistral': 515, 'n_tokens_neox': 505, 'n_words': 102}