Use conditional logging best practice