|
@ -2,16 +2,20 @@ |
|
|
class BasicFormatter < SemanticLogger::Formatters::Color |
|
|
class BasicFormatter < SemanticLogger::Formatters::Color |
|
|
ANSI_REVERSED_WARNING = "\e[0;30;43m".freeze |
|
|
ANSI_REVERSED_WARNING = "\e[0;30;43m".freeze |
|
|
ANSI_REVERSED_ERROR = "\e[1;30;41m".freeze |
|
|
ANSI_REVERSED_ERROR = "\e[1;30;41m".freeze |
|
|
ANSI_REVERSED_FATAL = "\e[1;30;45m".freeze |
|
|
|
|
|
|
|
|
ANSI_REVERSED_FATAL = "\e[1;30;41m".freeze |
|
|
ANSI_GRAY = "\e[90m".freeze |
|
|
ANSI_GRAY = "\e[90m".freeze |
|
|
|
|
|
ANSI_GREEN = SemanticLogger::AnsiColors::GREEN |
|
|
|
|
|
ANSI_YELLOW = SemanticLogger::AnsiColors::YELLOW |
|
|
|
|
|
ANSI_RED = SemanticLogger::AnsiColors::RED |
|
|
|
|
|
ANSI_MAGENTA = SemanticLogger::AnsiColors::MAGENTA |
|
|
|
|
|
|
|
|
def initialize |
|
|
def initialize |
|
|
super(time_format: nil, |
|
|
super(time_format: nil, |
|
|
color_map: ColorMap.new( |
|
|
color_map: ColorMap.new( |
|
|
debug: ANSI_GRAY, |
|
|
debug: ANSI_GRAY, |
|
|
info: SemanticLogger::AnsiColors::GREEN, |
|
|
|
|
|
warn: SemanticLogger::AnsiColors::YELLOW, |
|
|
|
|
|
fatal: SemanticLogger::AnsiColors::MAGENTA |
|
|
|
|
|
|
|
|
info: ANSI_GREEN, |
|
|
|
|
|
warn: ANSI_YELLOW, |
|
|
|
|
|
fatal: ANSI_RED |
|
|
)) |
|
|
)) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
@ -49,7 +53,7 @@ class BasicFormatter < SemanticLogger::Formatters::Color |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
if backtrace.count.positive? |
|
|
if backtrace.count.positive? |
|
|
"-- #{ANSI_REVERSED_ERROR}#{log.exception.class}#{color_map.clear} #{color}#{log.exception.message}#{color_map.clear}#{SemanticLogger::AnsiColors::WHITE}\n\t#{backtrace.join("\n\t")}#{color_map.clear}\n\n" |
|
|
|
|
|
|
|
|
"-- #{ANSI_REVERSED_ERROR}#{log.exception.class}#{color_map.clear} #{color}#{log.exception.message}\n#{color} ↳ #{backtrace.join("\n ↳ ")}#{color_map.clear}\n\n" |
|
|
else |
|
|
else |
|
|
"-- #{ANSI_REVERSED_ERROR}#{log.exception.class}: #{log.exception.message}#{color_map.clear}\n\n" |
|
|
"-- #{ANSI_REVERSED_ERROR}#{log.exception.class}: #{log.exception.message}#{color_map.clear}\n\n" |
|
|
end |
|
|
end |
|
|