Presumably so someone installing for the first time can install an older version where they can set the toggle before upgrading to when the toggle is removed?
Maybe there's a misunderstanding. The old toggle is deprecated, but the plan is that you will always be able to use it. The new toggle is just a different setting and can still be used there on newer versions ("telemetry.telemetryLevel": "off").
> @john-aws It does respect your prior settings. If you disabled telemetry before it will still be disabled even though telemetryLevel is set to "on" by default. We always take the most restrictive of the two settings. You can confirm this by setting Log level to trace and seeing no telemetry is flowing in the output channel. The old setting will never be completely removed to prevent enablement of people who previously disabled telemetry but it is deprecated so we recommend setting this new setting to "off" and removing the older settings from your settings.json
So the truth table would look like this :
telemetryLevel newTelemetryLevel result
off off no telemetry sent
on off no telemetry sent
off on no telemetry sent
on on telemetry sent
The new telemetry level can be set to Off, Error, On.
The actual code is on github[2] and looks like this :
const newConfig = configurationService.getValue<TelemetryConfiguration>(TELEMETRY_SETTING_ID);
const oldConfig = configurationService.getValue(TELEMETRY_OLD_SETTING_ID);
// Check old config for disablement
if (oldConfig !== undefined && oldConfig === false) {
return TelemetryLevel.NONE;
}
switch (newConfig ?? TelemetryConfiguration.ON) {
case TelemetryConfiguration.ON:
return TelemetryLevel.USAGE;
case TelemetryConfiguration.ERROR:
return TelemetryLevel.ERROR;
case TelemetryConfiguration.OFF:
return TelemetryLevel.NONE;
}