aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2016-01-05 10:37:04 -0600
committerschneems <richard.schneeman@gmail.com>2016-01-05 16:24:35 -0600
commit9dcb1b9b074e313fe0d2a738345c623620f594a2 (patch)
tree35693e0e56b934be2a0e09584ec59831183e1380 /activesupport/lib/active_support
parentb7b508aa7908efb1c6ef6667e3087f4f6a4b508f (diff)
downloadrails-9dcb1b9b074e313fe0d2a738345c623620f594a2.tar.gz
rails-9dcb1b9b074e313fe0d2a738345c623620f594a2.tar.bz2
rails-9dcb1b9b074e313fe0d2a738345c623620f594a2.zip
Revert "Add Logger option to disable message broadcasts"
This reverts related commits due to #22917.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/logger.rb15
-rw-r--r--activesupport/lib/active_support/logger_silence.rb2
2 files changed, 4 insertions, 13 deletions
diff --git a/activesupport/lib/active_support/logger.rb b/activesupport/lib/active_support/logger.rb
index 65049f8498..3c9c86c30b 100644
--- a/activesupport/lib/active_support/logger.rb
+++ b/activesupport/lib/active_support/logger.rb
@@ -1,3 +1,4 @@
+require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/logger_silence'
require 'logger'
@@ -5,26 +6,16 @@ module ActiveSupport
class Logger < ::Logger
include LoggerSilence
- # If +true+, will broadcast all messages sent to this logger to any
- # logger linked to this one via +broadcast+.
- #
- # If +false+, the logger will still forward calls to +close+, +progname=+,
- # +formatter=+ and +level+ to any linked loggers, but no calls to +add+ or
- # +<<+.
- #
- # Defaults to +true+.
- attr_accessor :broadcast_messages # :nodoc:
-
# Broadcasts logs to multiple loggers.
def self.broadcast(logger) # :nodoc:
Module.new do
define_method(:add) do |*args, &block|
- logger.add(*args, &block) if broadcast_messages
+ logger.add(*args, &block)
super(*args, &block)
end
define_method(:<<) do |x|
- logger << x if broadcast_messages
+ logger << x
super(x)
end
diff --git a/activesupport/lib/active_support/logger_silence.rb b/activesupport/lib/active_support/logger_silence.rb
index 690e5596f7..125d81d973 100644
--- a/activesupport/lib/active_support/logger_silence.rb
+++ b/activesupport/lib/active_support/logger_silence.rb
@@ -42,4 +42,4 @@ module LoggerSilence
yield self
end
end
-end
+end \ No newline at end of file