1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
6 # log_reuse_info logs whatever the given block returns, if
7 # log_reuse_decisions is enabled. It accepts a block instead of a
8 # string because in some cases constructing the strings involves
9 # doing expensive things like database queries, and we want to skip
10 # those when logging is disabled.
11 def log_reuse_info(candidates=nil)
12 if Rails.configuration.Containers.LogReuseDecisions
15 msg = "have #{candidates.count} candidates " + msg
17 Rails.logger.info("find_reusable: " + msg)