|
@ -12,6 +12,7 @@ class BasicFormatter < SemanticLogger::Formatters::Color |
|
|
info: SemanticLogger::AnsiColors::GREEN, |
|
|
info: SemanticLogger::AnsiColors::GREEN, |
|
|
warn: SemanticLogger::AnsiColors::YELLOW, |
|
|
warn: SemanticLogger::AnsiColors::YELLOW, |
|
|
)) |
|
|
)) |
|
|
|
|
|
@time_format = nil if File.exist?(File.join(Rails.root, "Procfile.dev")) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def time |
|
|
def time |
|
@ -65,4 +66,16 @@ class BasicFormatter < SemanticLogger::Formatters::Color |
|
|
"-- #{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 |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def call(log, logger) |
|
|
|
|
|
self.color = color_map[log.level] |
|
|
|
|
|
self.log = log |
|
|
|
|
|
self.logger = logger |
|
|
|
|
|
|
|
|
|
|
|
if @time_format |
|
|
|
|
|
[time, level, process_info, tags, named_tags, duration, name, message, payload, exception].compact.join(" ") |
|
|
|
|
|
else |
|
|
|
|
|
[level, process_info, tags, named_tags, duration, name, message, payload, exception].compact.join(" ") |
|
|
|
|
|
end |
|
|
|
|
|
end |
|
|
end |
|
|
end |