<commit_before>require 'colorize'

# Logger.
class Logger
  def self.success(message)
    Logger.log message.colorize(:green).bold
  end

  def self.error(message)
    Logger.log message.colorize(:red).bold
  end

  def self.info(message)
    Logger.log message.colorize(:blue)
  end

  def self.message(message)
    Logger.log message
  end

  def self.log(message)
    puts message
  end
end<commit_msg>Logger: cosmetics + exit on error.<commit_after>require 'colorize'

# Logger.
class Logger

  # -------------------------------------------------------
  # Pre-formatted log.
  # -------------------------------------------------------

  # Public: Print a success message and exit.
  #
  # message  - message.
  #
  # Returns nothing.
  def self.success(message)
    Logger.log message.colorize(:green).bold
  end

  # Public: Print an error message and exit.
  #
  # message  - message.
  # exit_now - should exit the program? Default to true.
  #
  # Returns nothing.
  def self.error(message, exit_now: true)
    Logger.log message.colorize(:red).bold
    exit 1 if exit_now
  end

  # Public: Print an info message and exit.
  #
  # message  - message.
  #
  # Returns nothing.
  def self.info(message)
    Logger.log message.colorize(:blue)
  end

  # Public: Print a message and exit.
  #
  # message  - message.
  #
  # Returns nothing.
  def self.message(message)
    Logger.log message
  end

  # -------------------------------------------------------
  # Raw log.
  # -------------------------------------------------------

  def self.log(message)
    puts message
  end
end
{'fraction_non_alphanumeric': 0.2250157133878064, 'fraction_numerical': 0.0006285355122564425, 'mean_word_length': 1.6891891891891893, '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': '2091793', 'n_tokens_mistral': 471, 'n_tokens_neox': 459, 'n_words': 126}