<commit_before>require 'capistrano/cli'
module Strano
  # Defines constants and methods related to configuration
  class CLI < Capistrano::CLI

    attr_accessor :logger


    def self.parse(logger, args)
      cli = new(args)
      cli.parse_options!

      @logger = logger
      @logger.level = Strano::Logger::TRACE

      cli.logger = logger
      cli
    end

    # Override in order to use DB logger
    def instantiate_configuration(options={})
      config = CapistranoMonkey::Configuration.new(options)
      config.logger = logger
      config
    end

    # Override in order to use DB logger
    def handle_error(error)
      if error.is_a?(Net::SSH::AuthenticationFailed)
        logger.important "authentication failed for `#{error.message}'"
      else
        logger.important error.message
        logger.trace error.backtrace.join("\n")
      end

      false
    end

  end
end<commit_msg>Making sure error message is HTML encoded<commit_after>require 'capistrano/cli'
module Strano
  # Defines constants and methods related to configuration
  class CLI < Capistrano::CLI

    attr_accessor :logger


    def self.parse(logger, args)
      cli = new(args)
      cli.parse_options!

      @logger = logger
      @logger.level = Strano::Logger::TRACE

      cli.logger = logger
      cli
    end

    # Override in order to use DB logger
    def instantiate_configuration(options={})
      config = CapistranoMonkey::Configuration.new(options)
      config.logger = logger
      config
    end

    # Override in order to use DB logger
    def handle_error(error)
      if error.is_a?(Net::SSH::AuthenticationFailed)
        logger.important "authentication failed for `#{error.message}'"
      else
        logger.important CGI::escapeHTML(error.message)
        logger.trace error.backtrace.join("\n")
      end

      false
    end

  end
end
{'fraction_non_alphanumeric': 0.08266237251744499, 'fraction_numerical': 0.0, 'mean_word_length': 2.6910891089108913, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2177321', 'n_tokens_mistral': 551, 'n_tokens_neox': 523, 'n_words': 147}