Add a condition to logging