Conditionalised logging.