<commit_before>require "logger"

# Add default_logger accessor into Object
def default_logger
  @@default_logger ||= Logger.new(STDOUT).tap do |logger|
    time_format = RUBY_VERSION =~ /1\.8\./ ? '%H:%M:%S.%N' : '%H:%M:%S.%3N'
    logger.formatter = proc do |level, time, prog, msg|

      "#{time.strftime(time_format)} #{msg}\n"
    end
    logger.level = Logger::INFO
  end
end

def default_logger= logger
  @@default_logger = logger
end

# Add universally accessible log method/accessor into Object
def log *args
  default_logger.tap do |logger|
    logger.fatal *args unless args.empty?
  end
end












<commit_msg>use a class instance variable instead of a class variable<commit_after>require "logger"

# Add default_logger accessor into Object
def default_logger
  @default_logger ||= Logger.new(STDOUT).tap do |logger|
    time_format = RUBY_VERSION =~ /1\.8\./ ? '%H:%M:%S.%N' : '%H:%M:%S.%3N'
    logger.formatter = proc do |level, time, prog, msg|

      "#{time.strftime(time_format)} #{msg}\n"
    end
    logger.level = Logger::INFO
  end
end

def default_logger= logger
  @default_logger = logger
end

# Add universally accessible log method/accessor into Object
def log *args
  default_logger.tap do |logger|
    logger.fatal *args unless args.empty?
  end
end

{'fraction_non_alphanumeric': 0.1277258566978193, 'fraction_numerical': 0.004672897196261682, 'mean_word_length': 3.724264705882353, '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': '60803', 'n_tokens_mistral': 446, 'n_tokens_neox': 419, 'n_words': 123}