Skip to content

Commit 944bc89

Browse files
committed
Improve compatibility between Logger and ActiveSupport::BroadcastLogger
The usage of `dispatch` in all logging methods causes common usages such as `logger.info` to return an array of loggers, making it unsafe for an application to upgrade to Rails 7.1. Returning `nil` is more efficient, and is the default behavior when using `Logger`.
1 parent a054307 commit 944bc89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activesupport/test/broadcast_logger_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def info(msg, &block)
302302
assert_same logger, broadcast_logger.broadcasts.sole
303303
end
304304

305-
test "logging has no return value" do
305+
test "logging always returns true" do
306306
assert_equal true, @logger.info("Hello")
307307
assert_equal true, @logger.error("Hello")
308308
end

0 commit comments

Comments
 (0)