- # doing database queries, and we want to skip those queries when
- # logging is disabled.
- def log_reuse_info
- if Rails.configuration.log_reuse_decisions
- Rails.logger.info("find_reusable: " + yield)
+ # doing expensive things like database queries, and we want to skip
+ # those when logging is disabled.
+ def log_reuse_info(candidates=nil)
+ if Rails.configuration.Containers.LogReuseDecisions
+ msg = yield
+ if !candidates.nil?
+ msg = "have #{candidates.count} candidates " + msg
+ end
+ Rails.logger.info("find_reusable: " + msg)