Adds debug-logging check to some expressions