Merge "diag: Clearing the mask before switching logging mode"