Pass logging message through block.

This follows the good practice listed on http://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance
Merge pull request #16633 from tgxworld/prefer_log_message_through_block

Pass logging message through block.