From 0f53b010f963e625a5c02edbb7500b52630ec34c Mon Sep 17 00:00:00 2001 From: Anton Davydov Date: Mon, 25 May 2015 01:47:40 +0300 Subject: [skip ci] Add documentation for Deprecation::Behavior module --- activesupport/lib/active_support/deprecation/behaviors.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/activesupport/lib/active_support/deprecation/behaviors.rb b/activesupport/lib/active_support/deprecation/behaviors.rb index 9f9dca8453..0cdc7e96f7 100644 --- a/activesupport/lib/active_support/deprecation/behaviors.rb +++ b/activesupport/lib/active_support/deprecation/behaviors.rb @@ -38,6 +38,18 @@ module ActiveSupport silence: ->(message, callstack) {}, } + # Behavior module allows to determine how to display deprecation messages. + # You can set any behaviors from +DEFAULT_BEHAVIORS+ constant or create + # custom behavior. Available behaviors: + # + # [+raise+] Raise ActiveSupport::DeprecationException. + # [+stderr+] Log all deprecation warnings to +$stderr+. + # [+log+] Log all deprecation warnings to +Rails.logger+. + # [+notify+] Use +ActiveSupport::Notifications+ to notify +deprecation.rails+. + # [+silence+] Do nothing. + # + # Setting behaviors only affects deprecations that happen after boot time. + # For more information you can read documentation for +behavior=+ method. module Behavior # Whether to print a backtrace along with the warning. attr_accessor :debug -- cgit v1.2.3