aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/logger_thread_safe_level.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix the LoggerSilence to work as described:Edouard CHIN2018-10-021-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* LoggerSilence doesn't require concurrent:Edouard CHIN2018-09-281-0/+1
| | | | - LoggerThreadSafeLevel does nowaday since 2518bda97cbbcb33dc9a92e70d5b01c09e64d12d
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-1/+1
| | | | 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-1/+1
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Make internal class as nodocRafael Mendonça França2016-02-241-2/+2
| | | | Also use the new hash syntax.
* Fix logger silencing for broadcasted loggersPiotr Jakubowski2016-02-111-0/+31
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.