|
|
@ -6,8 +6,7 @@ class BasicFormatter < SemanticLogger::Formatters::Color |
|
|
|
ANSI_DEBUG = "\e[90m".freeze |
|
|
|
ANSI_INFO = SemanticLogger::AnsiColors::GREEN |
|
|
|
ANSI_WARN = SemanticLogger::AnsiColors::YELLOW |
|
|
|
ANSI_ERROR = SemanticLogger::AnsiColors::RED |
|
|
|
ANSI_FATAL = SemanticLogger::AnsiColors::MAGENTA |
|
|
|
ANSI_ERROR = "\e[91m".freeze |
|
|
|
ANSI_NEUTRAL_INFO = SemanticLogger::AnsiColors::WHITE |
|
|
|
ANSI_REVERSED_WARNING = "\e[0;30;43m".freeze |
|
|
|
ANSI_REVERSED_ERROR = "\e[1;30;41m".freeze |
|
|
@ -21,6 +20,16 @@ class BasicFormatter < SemanticLogger::Formatters::Color |
|
|
|
fatal: ANSI_REVERSED_FATAL |
|
|
|
) |
|
|
|
|
|
|
|
EXCLUDE_LAMBDA = lambda { |log| |
|
|
|
if log.name == 'ActionView::Base' |
|
|
|
!log.message.starts_with?(' Rendering') |
|
|
|
elsif log.name == 'Rails' && !log.message.nil? |
|
|
|
log.message.exclude?('Started GET "/rails/live/reload') |
|
|
|
else |
|
|
|
true |
|
|
|
end |
|
|
|
} |
|
|
|
|
|
|
|
def initialize |
|
|
|
super(color_map: ColorMap.new( |
|
|
|
debug: ANSI_DEBUG, |
|
|
@ -65,7 +74,6 @@ class BasicFormatter < SemanticLogger::Formatters::Color |
|
|
|
self.color = color_map[log.level] |
|
|
|
self.log = log |
|
|
|
self.logger = logger |
|
|
|
|
|
|
|
[name, level, tags, named_tags, duration, message, payload, exception].compact.join(' ') |
|
|
|
end |
|
|
|
|
|
|
|