lib/async/logger.rb in async-1.15.2 vs lib/async/logger.rb in async-1.15.3
- old
+ new
@@ -67,10 +67,11 @@
@terminal = Terminal.new(output)
@reset_style = @terminal.reset
@prefix_style = @terminal.color(Terminal::Colors::CYAN)
@subject_style = @terminal.color(nil, nil, Terminal::Attributes::BOLD)
@exception_title_style = @terminal.color(Terminal::Colors::RED, nil, Terminal::Attributes::BOLD)
+ @exception_details_style = @terminal.color(Terminal::Colors::YELLOW)
@exception_line_style = @terminal.color(Terminal::Colors::RED)
@subjects = {}
end
@@ -136,10 +137,16 @@
format_value(argument, output: output)
end
end
def format_exception(exception, prefix = nil, pwd: Dir.pwd, output: @output)
- output.puts " #{prefix}#{@exception_title_style}#{exception.class}#{@reset_style}: #{exception}"
+ lines = exception.message.lines.map{|line| line.chomp!}
+
+ output.puts " #{prefix}#{@exception_title_style}#{exception.class}#{@reset_style}: #{lines.shift}"
+
+ lines.each do |line|
+ output.puts " #{@exception_details_style}" + line + @reset_style
+ end
exception.backtrace.each_with_index do |line, index|
path, offset, message = line.split(":")
# Make the path a bit more readable