Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #6688 from c42engineering/buffered_logger_level_wh…

…ile_creation

BufferedLogger level while creation
  • Loading branch information...
commit 35c89a48037391a10de0d12aa094c988a576d900 2 parents 5dfb01e + 01f8f29
@rafaelfranca rafaelfranca authored
View
4 activesupport/lib/active_support/buffered_logger.rb
@@ -45,7 +45,6 @@ def silence(temporary_level = ERROR)
deprecate :auto_flushing
def initialize(log, level = DEBUG)
- @level = level
@log_dest = log
unless log.respond_to?(:write)
@@ -58,6 +57,7 @@ def initialize(log, level = DEBUG)
end
@log = open_logfile log
+ self.level = level
end
def open_log(log, mode)
@@ -91,7 +91,7 @@ def #{severity.downcase}(message = nil, progname = nil, &block) # def debug(mess
end # end
def #{severity.downcase}? # def debug?
- #{severity} >= level # DEBUG >= @level
+ #{severity} >= level # DEBUG >= level
end # end
EOT
end
View
5 activesupport/test/buffered_logger_test.rb
@@ -62,6 +62,11 @@ def test_write_binary_data_create_file
File.unlink fname
end
+ def test_should_default_logger_level_to_one_passed_while_creating_it
+ logger = Logger.new(@output, Logger::ERROR)
+ assert_equal Logger::ERROR, logger.level
+ end
+
def test_should_log_debugging_message_when_debugging
@logger.level = Logger::DEBUG
@logger.add(Logger::DEBUG, @message)
Please sign in to comment.
Something went wrong with that request. Please try again.