aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/logger_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* applies new string literal convention in activesupport/testXavier Noria2016-08-061-12/+12
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Make sure the yielded variable is the loggerRafael Mendonça França2016-06-101-2/+4
|
* Be explicit about what Logger class is expectedKevin McPhillips2016-06-091-3/+3
|
* Fix logger silencing for broadcasted loggersPiotr Jakubowski2016-02-111-0/+44
| | | | | | | | | | | 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.
* [close #22917] Don't output to `STDOUT` twiceschneems2016-01-061-2/+10
| | | | | | | | | | | | | | When `rails console` or `rails server` are used along with a logger set to output to `STDOUT` then the contents will show up twice. This happens because the logger is extended with `ActiveSupportLogger.broadcast` with a destination of STDOUT even if it is already outputting to `STDOUT`. Previously PR #22592 attempted to fix this issue, but it ended up causing NoMethodErrors. A better approach than relying on adding a method and flow control is to inspect the log destination directly. For this `ActiveSupport::Logger.logger_outputs_to?` was introduced ```ruby logger = Logger.new(STDOUT) ActiveSupport::Logger.logger_outputs_to?(logger, STDOUT) # => true ``` To accomplish this we must look inside of an instance variable of standard lib's Logger `@logdev`. There is a related Ruby proposal to expose this method in a standard way: https://bugs.ruby-lang.org/issues/11955
* Fixes LoggerSilence#silence threadsafetyCarl P. Corliss2015-12-231-2/+83
| | | | | | | - 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 ActiveSupport::Logger#silence that works the same as the old ↵David Heinemeier Hansson2012-12-211-0/+10
| | | | Logger#silence extension
* no more deprecation required.Arun Agrawal2012-03-311-2/+0
|
* No more BufferedLogger so it can be LoggerTestArun Agrawal2012-03-311-0/+125