Permalink
Browse files

ActiveSupport::BufferedLogger can be subclassed

  • Loading branch information...
1 parent 501175e commit 433ebbdc4c82fbf0fba7851d73f9f963c105f16d @senny senny committed Dec 25, 2012
@@ -2,6 +2,10 @@
require 'active_support/logger'
module ActiveSupport
- BufferedLogger = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(
- 'BufferedLogger', '::ActiveSupport::Logger')
+ class BufferedLogger < Logger
+ def self.inherited(*)
+ ::ActiveSupport::Deprecation.warn 'ActiveSupport::BufferedLogger is deprecated! Use ActiveSupport::Logger instead.'
+ super
+ end
+ end
end
@@ -0,0 +1,14 @@
+require 'abstract_unit'
+require 'active_support/buffered_logger'
+
+class BufferedLoggerTest < ActiveSupport::TestCase
+
+ def test_can_be_subclassed
+ warn = 'ActiveSupport::BufferedLogger is deprecated! Use ActiveSupport::Logger instead.'
+
+ ActiveSupport::Deprecation.expects(:warn).with(warn).once
+
+ Class.new(ActiveSupport::BufferedLogger)
+ end
+
+end

0 comments on commit 433ebbd

Please sign in to comment.