What is best practice for writing to console/log

A post was split to a new topic: How to write message to console log?