|
@ -119,14 +119,14 @@ class AnsiFormatter < SemanticLogger::Formatters::Color |
|
|
log.level = :debug |
|
|
log.level = :debug |
|
|
log.message.lstrip! |
|
|
log.message.lstrip! |
|
|
if log.name == 'ActiveRecord::Base' && log.message.starts_with?('↳ ') |
|
|
if log.name == 'ActiveRecord::Base' && log.message.starts_with?('↳ ') |
|
|
log.message = AnsiCommon.ansi_trace(log.message) |
|
|
|
|
|
|
|
|
log.message = AnsiCommon.ansi_trace(log.message, '⇄') |
|
|
elsif log.name == 'ActionView::Base' |
|
|
elsif log.name == 'ActionView::Base' |
|
|
match = log.message.match(/^Rendered( layout| collection of|) (.*?\.erb)(.*)(\(Duration:.*\))/) |
|
|
match = log.message.match(/^Rendered( layout| collection of|) (.*?\.erb)(.*)(\(Duration:.*\))/) |
|
|
if match |
|
|
if match |
|
|
m1, m2, m3, m4 = match.captures |
|
|
m1, m2, m3, m4 = match.captures |
|
|
duration = m4.match(/Duration: (\d+\.?\d*)ms/).match(1).to_f |
|
|
duration = m4.match(/Duration: (\d+\.?\d*)ms/).match(1).to_f |
|
|
duration = duration < RENDERED_VIEW_DURATION ? '' : m4.to_s |
|
|
duration = duration < RENDERED_VIEW_DURATION ? '' : m4.to_s |
|
|
log.message = "Rendered#{m1} #{m2}#{m3}#{duration}" |
|
|
|
|
|
|
|
|
log.message = "⇤ Rendered#{m1} app/views/#{m2}#{m3}#{duration}" |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
@ -148,7 +148,7 @@ class AnsiFormatter < SemanticLogger::Formatters::Color |
|
|
def stackisize(items) |
|
|
def stackisize(items) |
|
|
return '' if items.empty? |
|
|
return '' if items.empty? |
|
|
|
|
|
|
|
|
traces = items.map { |item| AnsiCommon.ansi_trace(item) } |
|
|
|
|
|
|
|
|
traces = items.map { |item| AnsiCommon.ansi_trace(item, '➟') } |
|
|
"\n#{traces.join("\n")}" |
|
|
"\n#{traces.join("\n")}" |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|