2 # log_reuse_info logs whatever the given block returns, if
3 # log_reuse_decisions is enabled. It accepts a block instead of a
4 # string because in some cases constructing the strings involves
5 # doing expensive things like database queries, and we want to skip
6 # those when logging is disabled.
7 def log_reuse_info(candidates=nil)
8 if Rails.configuration.log_reuse_decisions
11 msg = "have #{candidates.count} candidates " + msg
13 Rails.logger.info("find_reusable: " + msg)