aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/logger.rb
diff options
context:
space:
mode:
authorGuo Xiang Tan <tgx_world@hotmail.com>2016-10-24 18:26:13 +0800
committerGuo Xiang Tan <tgx_world@hotmail.com>2016-10-24 18:26:13 +0800
commit308e84e982b940983b4b3d5b41b0b3ac11fbae40 (patch)
tree89d58e3f8e03555cf0474d62c5fcad7cc8b881fd /activesupport/lib/active_support/logger.rb
parenta0d0648efb5faa5d8d94a090e8b6ff498a7a9475 (diff)
downloadrails-308e84e982b940983b4b3d5b41b0b3ac11fbae40.tar.gz
rails-308e84e982b940983b4b3d5b41b0b3ac11fbae40.tar.bz2
rails-308e84e982b940983b4b3d5b41b0b3ac11fbae40.zip
`Broadcast#silence` breaks custom loggers that does not include `LoggerSilence`.
Diffstat (limited to 'activesupport/lib/active_support/logger.rb')
-rw-r--r--activesupport/lib/active_support/logger.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/logger.rb b/activesupport/lib/active_support/logger.rb
index 3ba6461b57..ea09d7d2df 100644
--- a/activesupport/lib/active_support/logger.rb
+++ b/activesupport/lib/active_support/logger.rb
@@ -59,14 +59,14 @@ module ActiveSupport
define_method(:silence) do |level = Logger::ERROR, &block|
if logger.respond_to?(:silence)
logger.silence(level) do
- if respond_to?(:silence)
+ if defined?(super)
super(level, &block)
else
block.call(self)
end
end
else
- if respond_to?(:silence)
+ if defined?(super)
super(level, &block)
else
block.call(self)