<commit_before>require 'logger'

module Filum
  class Logger < ::Logger
    def context_id=(context_id)
      Thread.current[:context_id] = context_id
    end

    def info(str)
      super("#{DateTime.now} thread_id-#{Thread.current.object_id} #{caller[0]} [#{Thread.current[:context_id]}] INFO | #{str}")
    end

    def fatal(str)
      super("#{DateTime.now} thread_id-#{Thread.current.object_id} #{caller[0]} [#{Thread.current[:context_id]}] FATAL | #{str}")
    end

    def error(str)
      super("#{DateTime.now} thread_id-#{Thread.current.object_id} #{caller[0]} [#{Thread.current[:context_id]}] ERROR | #{str}")
    end

    def warn(str)
      super("#{DateTime.now} thread_id-#{Thread.current.object_id} #{caller[0]} [#{Thread.current[:context_id]}] WARN | #{str}")
    end

    def debug(str)
      super("#{DateTime.now} thread_id-#{Thread.current.object_id} #{caller[0]} [#{Thread.current[:context_id]}] DEBUG | #{str}")
    end
  end
end<commit_msg>Removed duplication from logger.<commit_after>require 'logger'

module Filum
  class Logger < ::Logger
    def context_id=(context_id)
      Thread.current[:context_id] = context_id
    end

    def info(str)
      super(format("INFO", str))
    end

    def fatal(str)
      super(format("FATAL", str))
    end

    def error(str)
      super(format("ERROR", str))
    end

    def warn(str)
      super(format("WARN", str))
    end

    def debug(str)
      super(format("DEBUG", str))
    end

    private
    def fromat(level, str)
      "#{DateTime.now} thread_id-#{Thread.current.object_id} #{caller[0]} [#{Thread.current[:context_id]}] #{level} | #{str}"
    end
  end
end
{'fraction_non_alphanumeric': 0.17264437689969606, 'fraction_numerical': 0.00364741641337386, 'mean_word_length': 3.559556786703601, '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': '4469476', 'n_tokens_mistral': 567, 'n_tokens_neox': 564, 'n_words': 111}