<commit_before>module Fog
  class Logger

    @channels = {
      :deprecation  => ::STDOUT,
      :warning      => ::STDOUT
    }

    def self.[](channel)
      @channels[channel]
    end

    def self.[]=(channel, value)
      @channels[channel] = value
    end

    def self.debug(message)
      self.write(:debug, "[light_black][DEBUG] #{message}[/]")
    end

    def self.deprecation(message)
      self.write(:deprecation, "[yellow][DEPRECATION] #{message}[/]")
    end

    def self.warning(message)
      self.write(:warning, "[yellow][WARNING] #{message}[/]")
    end

    def self.write(key, value)
      if channel = @channels[key]
        value.gsub(Formatador::INDENT_REGEX, '')
        message = if channel.tty?
          value.gsub(Formatador::PARSE_REGEX) { "\e[#{Formatador::STYLES[$1.to_sym]}m" }.gsub(Formatador::INDENT_REGEX, '')
        else
          value.gsub(Formatador::PARSE_REGEX, '').gsub(Formatador::INDENT_REGEX, '')
        end<commit_msg>[core] add newlines to logger messages<commit_after>module Fog
  class Logger

    @channels = {
      :deprecation  => ::STDOUT,
      :warning      => ::STDOUT
    }

    def self.[](channel)
      @channels[channel]
    end

    def self.[]=(channel, value)
      @channels[channel] = value
    end

    def self.debug(message)
      self.write(:debug, "[light_black][DEBUG] #{message}[/]\n")
    end

    def self.deprecation(message)
      self.write(:deprecation, "[yellow][DEPRECATION] #{message}[/]\n")
    end

    def self.warning(message)
      self.write(:warning, "[yellow][WARNING] #{message}[/]\n")
    end

    def self.write(key, value)
      if channel = @channels[key]
        value.gsub(Formatador::INDENT_REGEX, '')
        message = if channel.tty?
          value.gsub(Formatador::PARSE_REGEX) { "\e[#{Formatador::STYLES[$1.to_sym]}m" }.gsub(Formatador::INDENT_REGEX, '')
        else
          value.gsub(Formatador::PARSE_REGEX, '').gsub(Formatador::INDENT_REGEX, '')
        end
{'fraction_non_alphanumeric': 0.16439049064238745, 'fraction_numerical': 0.0010116337885685382, 'mean_word_length': 2.8557504873294346, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5358362', 'n_tokens_mistral': 682, 'n_tokens_neox': 658, 'n_words': 112}