|
@ -26,10 +26,10 @@ class AnsiFormatter < SemanticLogger::Formatters::Color |
|
|
fatal: CLEAR + BG_MAGENTA + BOLD + TEXT_WHITE |
|
|
fatal: CLEAR + BG_MAGENTA + BOLD + TEXT_WHITE |
|
|
)) |
|
|
)) |
|
|
@memory = nil |
|
|
@memory = nil |
|
|
puts 'INITIALIZED2' |
|
|
|
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def call(log, logger) |
|
|
def call(log, logger) |
|
|
|
|
|
# puts caller_locations(1, 15) |
|
|
log = alter(log) |
|
|
log = alter(log) |
|
|
|
|
|
|
|
|
self.log = log |
|
|
self.log = log |
|
@ -40,8 +40,7 @@ class AnsiFormatter < SemanticLogger::Formatters::Color |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def reject(log) |
|
|
def reject(log) |
|
|
log.name == 'ScoresController' || false |
|
|
|
|
|
false |
|
|
|
|
|
|
|
|
true if log.name == 'ActionView::Base' && log.message.starts_with?(' Rendering') |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
private |
|
|
private |
|
@ -49,6 +48,7 @@ class AnsiFormatter < SemanticLogger::Formatters::Color |
|
|
def alter(log) |
|
|
def alter(log) |
|
|
if log.name == 'Rails' |
|
|
if log.name == 'Rails' |
|
|
if log.message |
|
|
if log.message |
|
|
|
|
|
log.message.lstrip! |
|
|
log.message.chomp!('') |
|
|
log.message.chomp!('') |
|
|
if log.message.starts_with?('Started') |
|
|
if log.message.starts_with?('Started') |
|
|
rails = '╓─╖' |
|
|
rails = '╓─╖' |
|
@ -68,6 +68,8 @@ class AnsiFormatter < SemanticLogger::Formatters::Color |
|
|
log.dimensions = AnsiDimensions.new(rails: '╙╨╜') |
|
|
log.dimensions = AnsiDimensions.new(rails: '╙╨╜') |
|
|
elsif log.message.starts_with?('Completed 5') |
|
|
elsif log.message.starts_with?('Completed 5') |
|
|
log.dimensions = AnsiDimensions.new(rails: "╙#{draw_fatal}╜") |
|
|
log.dimensions = AnsiDimensions.new(rails: "╙#{draw_fatal}╜") |
|
|
|
|
|
elsif log.message =~ /^(Processing|Parameters)/ |
|
|
|
|
|
log.level = :debug |
|
|
end |
|
|
end |
|
|
elsif log.exception |
|
|
elsif log.exception |
|
|
log.dimensions = AnsiDimensions.new( |
|
|
log.dimensions = AnsiDimensions.new( |
|
@ -76,7 +78,11 @@ class AnsiFormatter < SemanticLogger::Formatters::Color |
|
|
terminus: true |
|
|
terminus: true |
|
|
) |
|
|
) |
|
|
end |
|
|
end |
|
|
|
|
|
elsif log.name =~ /^(ActionView|ActiveRecord)::Base/ |
|
|
|
|
|
log.level = :debug |
|
|
|
|
|
log.message.lstrip! |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
log |
|
|
log |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|