lib/deprecation.rb in deprecation-0.0.5 vs lib/deprecation.rb in deprecation-0.1.0

- old
+ new

@@ -17,19 +17,35 @@ def silenced @silenced end + alias_method :silenced?, :silenced + def silenced= bool @silenced = bool end def debug @debug end + alias_method :debug?, :debug def debug= bool @debug = bool + end + + def self.logger + @logger ||= if defined?(Rails) && Rails.logger + Rails.logger + else + require 'active_support/logger' + ActiveSupport::Logger.new($stderr) + end + end + + def self.logger= value + @logger = value end included do class << self end