Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Only lookup `config.log_level` for stdlib `::Logger`. Closes #…

…11665."

This reverts commit e0a521c.

Conflicts:
	railties/CHANGELOG.md

We expect loggers to quack like stdlib logger. If log4r needs different
level= assignment, using a Logger-quacking wrapper is the way to do it.

Fixes #14114.
  • Loading branch information...
commit b1867c85fa934caad1cd7410e1bd9bc0463a2f42 1 parent c93c558
@guilleiguaran guilleiguaran authored
View
7 railties/CHANGELOG.md
@@ -25,13 +25,6 @@
*Cristian Mircea Messel*, *Chulki Lee*
-* Only lookup `config.log_level` for stdlib `::Logger` instances.
- Assign it as is for third party loggers like `Log4r::Logger`.
-
- Fixes #13421.
-
- *Yves Senn*
-
* The `Gemfile` of new applications depends on SDoc ~> 0.4.0.
*Xavier Noria*
View
6 railties/lib/rails/application/bootstrap.rb
@@ -53,11 +53,7 @@ module Bootstrap
logger
end
- if ::Logger === Rails.logger
- Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase)
- else
- Rails.logger.level = config.log_level
- end
+ Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase)
end
# Initialize cache early in the stack so railties can make use of it.
View
15 railties/test/application/configuration_test.rb
@@ -762,7 +762,7 @@ def index
end
end
- test "lookup config.log_level with custom logger (stdlib Logger)" do
+ test "config.log_level with custom logger" do
make_basic_app do |app|
app.config.logger = Logger.new(STDOUT)
app.config.log_level = :info
@@ -770,19 +770,6 @@ def index
assert_equal Logger::INFO, Rails.logger.level
end
- test "assign log_level as is with custom logger (third party logger)" do
- logger_class = Class.new do
- attr_accessor :level
- end
- logger_instance = logger_class.new
- make_basic_app do |app|
- app.config.logger = logger_instance
- app.config.log_level = :info
- end
- assert_equal logger_instance, Rails.logger
- assert_equal :info, Rails.logger.level
- end
-
test "respond_to? accepts include_private" do
make_basic_app
Please sign in to comment.
Something went wrong with that request. Please try again.