|
|
@ -1,6 +1,7 @@ |
|
|
|
require_relative 'ansi_wrapper' |
|
|
|
require_relative 'ansi_colors' |
|
|
|
require_relative 'ansi_dimensions' |
|
|
|
require_relative 'ansi_common' |
|
|
|
|
|
|
|
require 'io/console' |
|
|
|
require 'amazing_print' |
|
|
@ -81,6 +82,9 @@ class AnsiFormatter < SemanticLogger::Formatters::Color |
|
|
|
elsif log.name =~ /^(ActionView|ActiveRecord)::Base/ |
|
|
|
log.level = :debug |
|
|
|
log.message.lstrip! |
|
|
|
if log.name == 'ActiveRecord::Base' && log.message.starts_with?('↳ ') |
|
|
|
log.message = AnsiCommon.ansi_trace(log.message) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
log |
|
|
@ -99,13 +103,7 @@ class AnsiFormatter < SemanticLogger::Formatters::Color |
|
|
|
def stackisize(items) |
|
|
|
return '' if items.empty? |
|
|
|
|
|
|
|
traces = items.map do |item| |
|
|
|
trace = item.match(/(.*:\d+):in `(.*)'/) |
|
|
|
next item unless trace |
|
|
|
|
|
|
|
m1, m2 = trace.captures |
|
|
|
"↳ #{m1} #{AnsiColors::BOLD}#{m2}#{AnsiColors::CLEAR}" |
|
|
|
end |
|
|
|
traces = items.map { |item| AnsiCommon.ansi_trace(item) } |
|
|
|
"\n#{traces.join("\n")}" |
|
|
|
end |
|
|
|
|
|
|
|