diff --git a/config/initializers/silence_logger.rb b/config/initializers/silence_logger.rb new file mode 100644 index 0000000..830f750 --- /dev/null +++ b/config/initializers/silence_logger.rb @@ -0,0 +1,2 @@ +Rails.logger.level = :info +ActionView::Base.logger.level = :info diff --git a/lib/formatters/basic_formatter.rb b/lib/formatters/basic_formatter.rb index bdda1ac..7ccb437 100644 --- a/lib/formatters/basic_formatter.rb +++ b/lib/formatters/basic_formatter.rb @@ -30,7 +30,11 @@ class BasicFormatter < SemanticLogger::Formatters::Color else log.message end - "#{prefix} #{SemanticLogger::AnsiColors::WHITE}#{message}#{color_map.clear}" + if log.name == "Rails" || log.name == "ActionView::Base" + "#{prefix} #{color}#{message}#{color_map.clear}" + else + "#{prefix} #{SemanticLogger::AnsiColors::WHITE}#{message}#{color_map.clear}" + end when :warn "#{prefix} #{ANSI_REVERSED_WARNING}#{log.message}#{color_map.clear}" when :error, :fatal