From e12ffb76ffcedd150e7d0c3dc4f93472aa4790cb Mon Sep 17 00:00:00 2001 From: Nate Smith Date: Mon, 14 Dec 2015 17:27:03 -0500 Subject: Add Logger option to disable message broadcasts When setting the Rails logger to log to STDOUT, it would broadcast the log twice in development. This adds a setting that will prevent messages from being broadcast to multiple logs, while still allowing calls to `#close`, `#level=`, `#progname=`, and `#formatter=` to be broadcasted. Fixes #14769, #11415 --- activesupport/lib/active_support/logger_silence.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support/logger_silence.rb') diff --git a/activesupport/lib/active_support/logger_silence.rb b/activesupport/lib/active_support/logger_silence.rb index a8efdef944..7d92256f24 100644 --- a/activesupport/lib/active_support/logger_silence.rb +++ b/activesupport/lib/active_support/logger_silence.rb @@ -1,8 +1,9 @@ require 'active_support/concern' +require 'active_support/core_ext/module/attribute_accessors' module LoggerSilence extend ActiveSupport::Concern - + included do cattr_accessor :silencer self.silencer = true @@ -21,4 +22,4 @@ module LoggerSilence yield self end end -end \ No newline at end of file +end -- cgit v1.2.3