Merge "Remove the flag gating logging and fix a bug." into sc-dev