<commit_before>require "yell"

module Volley
  class Log
    class << self
      def init
        @loggers           = { }
        @loggers["STDOUT"] = Yell.new(STDOUT, :level => [:info, :warn], :format => Yell::NoFormat)
        @loggers["STDERR"] = Yell.new(STDERR, :level => [:error, :fatal], :format => Yell::NoFormat)
      end

      def add(level, dest, format=Yell::DefaultFormat)
        if [STDOUT, STDERR].include?(dest)
          console_disable
          @loggers["STDOUT"] = Yell.new(dest, :level => level, :format => format)
        else
          @loggers.delete(dest) if @loggers[dest]
          FileUtils.mkdir_p(File.dirname(dest))
          @loggers[dest] = Yell.new(:datefile, dest,
                                    :level => level, :format => format,
                                    :keep  => 7, :symlink_original_filename => true)
        end
      end

      def console_disable
        %w{STDOUT STDERR}.each { |s| @loggers.delete(s) }
      end

      def console_debug
        console_disable
        @loggers["STDOUT"] = Yell.new(STDOUT, :level => [:debug, :info, :warn], :format => Yell::NoFormat)
        @loggers["STDERR"] = Yell.new(STDERR, :level => [:error, :fatal], :format => Yell::NoFormat)
      end

      def console_quiet
        console_disable
        @loggers["STDOUT"] = Yell.new(STDOUT, :level => [:warn], :format => Yell::NoFormat)
        @loggers["STDERR"] = Yell.new(STDERR, :level => [:error, :fatal], :format => Yell::NoFormat)
      end<commit_msg>fix depcrated config for Yell<commit_after>require "yell"

module Volley
  class Log
    class << self
      def init
        @loggers           = { }
        @loggers["STDOUT"] = Yell.new(STDOUT, :level => [:info, :warn], :format => Yell::NoFormat)
        @loggers["STDERR"] = Yell.new(STDERR, :level => [:error, :fatal], :format => Yell::NoFormat)
      end

      def add(level, dest, format=Yell::DefaultFormat)
        if [STDOUT, STDERR].include?(dest)
          console_disable
          @loggers["STDOUT"] = Yell.new(dest, :level => level, :format => format)
        else
          @loggers.delete(dest) if @loggers[dest]
          FileUtils.mkdir_p(File.dirname(dest))
          @loggers[dest] = Yell.new(:datefile, dest,
                                    :level => level, :format => format,
                                    :keep  => 7, :symlink => true)
        end
      end

      def console_disable
        %w{STDOUT STDERR}.each { |s| @loggers.delete(s) }
      end

      def console_debug
        console_disable
        @loggers["STDOUT"] = Yell.new(STDOUT, :level => [:debug, :info, :warn], :format => Yell::NoFormat)
        @loggers["STDERR"] = Yell.new(STDERR, :level => [:error, :fatal], :format => Yell::NoFormat)
      end

      def console_quiet
        console_disable
        @loggers["STDOUT"] = Yell.new(STDOUT, :level => [:warn], :format => Yell::NoFormat)
        @loggers["STDERR"] = Yell.new(STDERR, :level => [:error, :fatal], :format => Yell::NoFormat)
      end
{'fraction_non_alphanumeric': 0.15660252156602522, 'fraction_numerical': 0.0006635700066357001, 'mean_word_length': 2.302300109529025, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6566290', 'n_tokens_mistral': 1024, 'n_tokens_neox': 971, 'n_words': 205}