diff options
author | Nate Smith <nwjsmith@gmail.com> | 2015-12-14 17:27:03 -0500 |
---|---|---|
committer | Nate Smith <nwjsmith@gmail.com> | 2015-12-16 16:08:56 -0500 |
commit | e12ffb76ffcedd150e7d0c3dc4f93472aa4790cb (patch) | |
tree | 504153f7aa2365a26403b5fdea14104bc53eed83 /activesupport/lib/active_support/logger_silence.rb | |
parent | 87e44814679625b4d8093aea253fe49e23f2c1b4 (diff) | |
download | rails-e12ffb76ffcedd150e7d0c3dc4f93472aa4790cb.tar.gz rails-e12ffb76ffcedd150e7d0c3dc4f93472aa4790cb.tar.bz2 rails-e12ffb76ffcedd150e7d0c3dc4f93472aa4790cb.zip |
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
Diffstat (limited to 'activesupport/lib/active_support/logger_silence.rb')
-rw-r--r-- | activesupport/lib/active_support/logger_silence.rb | 5 |
1 files changed, 3 insertions, 2 deletions
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 |