<commit_before>module SimpleDeploy
  class SimpleDeployLogger
    
    def initialize(args = {})
      @logger = args[:logger] ||= Logger.new(STDOUT)
      @log_level = args[:log_level] ||= 'info'

      unless args[:logger]
        @logger.datetime_format = "%Y-%m-%d %H:%M:%S"
        @logger.formatter = proc do |severity, datetime, progname, msg|
            "#{datetime}: #{msg}\n"
        end
      end

      case @log_level.downcase
      when 'info'
        @logger.level = Logger::INFO
      when 'debug'
        @logger.level = Logger::DEBUG
      when 'warn'
        @logger.level = Logger::WARN
      when 'error'
        @logger.level = Logger::ERROR
      end
      @logger
    end

    def debug(msg)
      @logger.debug msg
    end

    def info(msg)
      @logger.info msg
    end

    def error(msg)
      @logger.error msg
    end
  end
end<commit_msg>fix output formatting<commit_after>module SimpleDeploy
  class SimpleDeployLogger

    def initialize(args = {})
      @log_level = args[:log_level] ||= 'info'
      @logger    = args[:logger] ||= new_logger(args)
    end

    def debug(msg)
      @logger.debug msg
    end

    def info(msg)
      @logger.info msg
    end

    def error(msg)
      @logger.error msg
    end

    private
    def new_logger(args)
      Logger.new(STDOUT).tap do |l|
        l.datetime_format = '%Y-%m-%dT%H:%M:%S%z'
        l.formatter = proc do |severity, datetime, progname, msg|
          "#{datetime} #{severity} : #{msg}\n"
        end
        l.level = logger_level
      end
    end

    def logger_level
      Logger.const_get @log_level.upcase
    end

  end
end
{'fraction_non_alphanumeric': 0.12046711739397664, 'fraction_numerical': 0.0, 'mean_word_length': 2.0833333333333335, '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': '7457874', 'n_tokens_mistral': 545, 'n_tokens_neox': 525, 'n_words': 125}