aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/logger_silence.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix the LoggerSilence to work as described:Edouard CHIN2018-10-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Following the Rails guide which state that a logger needs to include the `ActiveSupport::LoggerSilence` as well as `ActiveSupport::LoggerThreadSafe` modules isn't enough and won't work. Here is a test cases with 3 tests that all fails https://gist.github.com/Edouard-chin/4a72930c2b1eafbbd72a80c66f102010 The problems are the following: 1) The logger needs to call `after_initialize` in order to setup some instance variables. 2) The silence doesn't actually work because the bare ruby Logger `add` method checks for the instance variable `@logger`. We need to override the `add` (like we used to in the ActiveSupport::Logger class). 3) Calling `debug?` `info?` etc... doesn't work as the bare ruby methods will check for the instance variable. Again we need to override this methods (like we used to in the ActiveSupport::Logger class) The LoggerSilence won't work without LoggerThreadSafe, but the later is not public API, the user shouldn't have to include it so I modified to include it automatically. Same for the `after_initialize` method. I find unuintitive to have to call it directly. I modified to instance the variables when the module get included.
* Deprecate the `LoggerSilence` constant:Edouard CHIN2018-10-021-11/+26
| | | | | | | | - I found this weird that the LoggerSilence wasn't using the `ActiveSupport` namespace (AFAIK all other classes have it). This PR deprecate the use of `LoggerSilence` for `ActiveSupport::LoggerSilence` instead.
* LoggerSilence doesn't require concurrent:Edouard CHIN2018-09-281-1/+0
| | | | - LoggerThreadSafeLevel does nowaday since 2518bda97cbbcb33dc9a92e70d5b01c09e64d12d
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-2/+2
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-2/+2
|
* Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-031-2/+1
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-3/+3
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix logger silencing for broadcasted loggersPiotr Jakubowski2016-02-111-21/+4
| | | | | | | | | | | Fix #23609 Commit 629efb6 introduced thread safety to logger silencing but it didn't take into account the fact that the logger can be extended with broadcasting to other logger. This commit introduces local_level to broadcasting Module which enables broadcasted loggers to be properly silenced.
* Revert "Add Logger option to disable message broadcasts"schneems2016-01-051-1/+1
| | | | This reverts related commits due to #22917.
* Fixes LoggerSilence#silence threadsafetyCarl P. Corliss2015-12-231-2/+22
| | | | | | | - uses instance defined level if no custom local log level defined - Keeps track of local log level per [ thread + object-instance ] - prevents memory leakage by removing local level hash key/value on #silence method exit - avoids the use of Thread local variables
* Add Logger option to disable message broadcastsNate Smith2015-12-161-2/+3
| | | | | | | | | When setting the Rails logger to log to STDOUT, it would broadcast the log twice in development. This adds a setting that will prevent messages from being broadcast to multiple logs, while still allowing calls to `#close`, `#level=`, `#progname=`, and `#formatter=` to be broadcasted. Fixes #14769, #11415
* Revert "Make sure that ActiveSupport::Logger includes the Logger extensions ↵David Heinemeier Hansson2012-12-211-0/+24
| | | | | | from core_ext/logger" (some confusion over deprecation) This reverts commit d00f568a83a5159ed93618b1081bd17858536d1c.
* Make sure that ActiveSupport::Logger includes the Logger extensions from ↵David Heinemeier Hansson2012-12-211-24/+0
| | | | core_ext/logger
* Add ActiveSupport::Logger#silence that works the same as the old ↵David Heinemeier Hansson2012-12-211-0/+24
Logger#silence extension