lib/cc/cli.rb in codeclimate-0.69.0 vs lib/cc/cli.rb in codeclimate-0.70.0

- old
+ new

@@ -1,22 +1,20 @@ require "active_support" -require "active_support/core_ext/module/remove_method" # Temporary, see https://github.com/codeclimate/codeclimate/pull/658 require "active_support/core_ext" require "yaml" require "cc/analyzer" +require "cc/config" +require "cc/engine_registry" require "cc/workspace" -require "cc/yaml" require "cc/cli/analyze" require "cc/cli/command" require "cc/cli/console" require "cc/cli/engines" require "cc/cli/help" -require "cc/cli/init" require "cc/cli/output" require "cc/cli/prepare" -require "cc/cli/prepare/quality" require "cc/cli/runner" require "cc/cli/test" require "cc/cli/validate_config" require "cc/cli/version" @@ -24,17 +22,19 @@ module CLI def self.debug? ENV["CODECLIMATE_DEBUG"] end - def self.debug(message, values = {}) - if debug? - if values.any? - message << " " - message << values.map { |k, v| "#{k}=#{v.inspect}" }.join(" ") - end - - $stderr.puts("[DEBUG] #{message}") + def self.logger + @logger ||= ::Logger.new(STDERR).tap do |logger| + logger.level = + if debug? + ::Logger::DEBUG + else + ::Logger::ERROR + end end end end + + Analyzer.logger = CLI.logger end