aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/logger_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* [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