Rails.logger.debug
RB-W1009By default, Rails production environments use the :info
log level. At the :info
log level, Rails.logger.debug
statements do not result in log output.
However, Ruby must eagerly evaluate interpolated string arguments passed as method arguments. Passing a block to Rails.logger.debug
prevents costly evaluation of interpolated strings when no output would be produced anyway.
logger.debug "Person attributes hash: #{@person.attributes.inspect}"
logger.debug { "Person attributes hash: #{@person.attributes.inspect}" }