aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/broadcast_logger_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #34055 from Edouard-chin/ec-logger-fixRafael França2018-10-031-1/+2
|\ | | | | Fix the LoggerSilence to work as described:
| * Fix the LoggerSilence to work as described:Edouard CHIN2018-10-021-1/+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.
* | :warning: assigned but unused variable - loggerAkira Matsuda2018-10-031-1/+1
|/
* Deprecate the `LoggerSilence` constant:Edouard CHIN2018-10-021-1/+9
| | | | | | | | - 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.
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Merge pull request #26874 from tgxworld/fix_broadcast_loggerMatthew Draper2016-11-251-3/+19
|\ | | | | `Broadcast#silence` breaks custom loggers that do not include `Logg…
| * `Broadcast#silence` breaks custom loggers that does not include `LoggerSilence`.Guo Xiang Tan2016-10-241-3/+19
| |
* | Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-1/+1
|/
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in activesupport/testXavier 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.
* Broadcast #silence on logger. Rewrite tests.Kevin McPhillips2016-06-091-31/+103
|
* Revert "Add Logger option to disable message broadcasts"schneems2016-01-051-32/+18
| | | | This reverts related commits due to #22917.
* Add Logger option to disable message broadcastsNate Smith2015-12-161-18/+32
| | | | | | | | | 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
* pushed broadcasting down to a moduleAaron Patterson2012-01-201-1/+6
|
* made the broadcast logger quack more like a loggerAaron Patterson2012-01-201-15/+35
|
* add a broadcasting logger so we can split logsAaron Patterson2012-01-201-0/+57