Simplified debug logging.

Also making sure they are always excluded from non-DEBUG builds.