lib/reviewer/logger.rb in reviewer-0.1.2 vs lib/reviewer/logger.rb in reviewer-0.1.3
- old
+ new
@@ -3,10 +3,17 @@
require 'colorize'
module Reviewer
# Clean formatter for logging to $stdout
class StandardOutFormatter < ::Logger::Formatter
+ # Overrides ::Logger::Formatter `call` to more present output more concisely
+ # @param _severity [Logger::Severity] Unused - Logger severity for etnry
+ # @param _time [DateTime] Unused - Timestamp for entry
+ # @param _progname [String] Unused - Name of the current program for entry
+ # @param message [String] The string to print to $stdout
+ #
+ # @return [type] [description]
def call(_severity, _time, _progname, message)
"#{message}\n"
end
end
@@ -24,26 +31,32 @@
def running(tool)
info "\n#{tool.name}".bold + ' · '.light_black + tool.description
end
def command(cmd)
- info "#{PROMPT} #{cmd}".light_black
+ info "\nReviewer ran this command:"
+ info cmd.to_s.light_black
end
- def rerunning(tool)
- info "\n\nRe-running #{tool.name} verbosely:"
+ def rerunning(tool, cmd)
+ info "\nRe-running #{tool.name} verbosely:"
+ info cmd.to_s.light_black
end
def success(elapsed_time)
info SUCCESS.green.bold + " (#{elapsed_time.round(3)}s)".green
end
def failure(message)
- info "#{FAILURE} #{message}".red.bold
+ error "#{FAILURE} #{message}".red.bold
end
+ def total_time(elapsed_time)
+ info "\n➤ Total Time: #{elapsed_time.round(3)}s\n"
+ end
+
def guidance(summary, details)
- info " #{summary}" if summary
- info " #{details}".light_black if details
+ info "\n#{summary}" if summary
+ info details.to_s.light_black if details
end
end
end