From b5074e2109dce7deab5c1fd241bb2ede580eff0a Mon Sep 17 00:00:00 2001 From: pvincent Date: Mon, 29 May 2023 19:59:54 +0400 Subject: [PATCH] filter out ActionView::Base Rendered internal gem --- app/controllers/main_controller.rb | 2 +- config/environments/development.rb | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index acc025c..57e99fd 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -9,7 +9,7 @@ class MainController < ApplicationController logger.warn "a warning" logger.error "an error" - # raise "this is an error" + raise "this is an error" sleep 3 end end diff --git a/config/environments/development.rb b/config/environments/development.rb index 131da86..feb3e47 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -69,5 +69,12 @@ Rails.application.configure do # config.action_cable.disable_request_forgery_protection = true # Semantic Logger in console log only! - config.semantic_logger.add_appender(io: $stdout, formatter: BasicFormatter.new) + config.semantic_logger.add_appender( + io: $stdout, + formatter: BasicFormatter.new, + filter: ->log { + return true if log.name != "ActionView::Base" + log.message.exclude?("Rendered /") && log.message.exclude?("Rendered layout /") + }, + ) end