how about this ?
logger.info(#{data}) if logger.debug?
instead of putting STDOUT in front of the string?