244
this._log(errorEventName, TelemetryLevel.ERROR, data);
245
}
247
>
publicLogError2<E extends ClassifiedEvent<OmitMetadata<T>> = never, T extends IGDPRProperty = never>(eventName: string, data?: StrictPropertyCheck<T, E>) {
248
this.publicLogError(eventName, data as ITelemetryData);
249
}
251
>
252
>
function getTelemetryLevelSettingDescription(): string {
253
>
const telemetryText = localize('telemetry.telemetryLevelMd', "Controls {0} telemetry, first-party extension telemetry, and participating third-party extension telemetry. Some third party extensions might not respect this setting. Consult the specific extension's documentation to be sure. Telemetry helps us better understand how {0} is performing, where improvements need to be made, and how features are being used.", product.nameLong);
254
>
const externalLinksStatement = !product.privacyStatementUrl ?
255
>
localize("telemetry.docsStatement", "Read more about the [data we collect]({0}).", 'https://aka.ms/vscode-telemetry') :
256
localize("telemetry.docsAndPrivacyStatement", "Read more about the [data we collect]({0}) and our [privacy statement]({1}).", 'https://aka.ms/vscode-telemetry', product.privacyStatementUrl);
257
>
const restartString = !isWeb ? localize('telemetry.restart', 'A full restart of the application is necessary for crash reporting changes to take effect.') : '';
telemetryService.ts
258
>
259
>
const crashReportsHeader = localize('telemetry.crashReports', "Crash Reports");
260
>
const errorsHeader = localize('telemetry.errors', "Error Telemetry");
261
>
const usageHeader = localize('telemetry.usage', "Usage Data");
262
>
263
>
const telemetryTableDescription = localize('telemetry.telemetryLevel.tableDescription', "The following table outlines the data sent with each setting:");
264
>
const telemetryTable = `
265
>
| | ${crashReportsHeader} | ${errorsHeader} | ${usageHeader} |
266
>
|:------|:-------------:|:---------------:|:----------:|
267
>
| all | ✓ | ✓ | ✓ |
268
>
| error | ✓ | ✓ | - |
269
>
| crash | ✓ | - | - |
270
>
| off | - | - | - |
271
>
`;
272
>
273
>
const deprecatedSettingNote = localize('telemetry.telemetryLevel.deprecated', "****Note:*** If this setting is 'off', no telemetry will be sent regardless of other telemetry settings. If this setting is set to anything except 'off' and telemetry is disabled with deprecated settings, no telemetry will be sent.*");
274
>
const telemetryDescription = `
275
>
${telemetryText} ${externalLinksStatement} ${restartString}
276
>
277
>
278
>
279
>
${telemetryTableDescription}
280
>
${telemetryTable}
281
>
282
>
283
>
284
>
${deprecatedSettingNote}
285
>
`;
286
>
287
>
return telemetryDescription;
288
>
}
289
>
290
>
const configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);
291
>
configurationRegistry.registerConfiguration({
292
>
'id': TELEMETRY_SECTION_ID,
293
>
'order': 1,
294
>
'type': 'object',
295
>
'title': localize('telemetryConfigurationTitle', "Telemetry"),
296
>
'properties': {
297
>
[TELEMETRY_SETTING_ID]: {
298
>
'type': 'string',
299
>
'enum': [TelemetryConfiguration.ON, TelemetryConfiguration.ERROR, TelemetryConfiguration.CRASH, TelemetryConfiguration.OFF],
300
>
'enumDescriptions': [
301
>
localize('telemetry.telemetryLevel.default', "Sends usage data, errors, and crash reports."),
302
>
localize('telemetry.telemetryLevel.error', "Sends general error telemetry and crash reports."),
303
>
localize('telemetry.telemetryLevel.crash', "Sends OS level crash reports."),
304
>
localize('telemetry.telemetryLevel.off', "Disables all product telemetry.")
305
>
],
306
>
'markdownDescription': getTelemetryLevelSettingDescription(),
307
>
'default': TelemetryConfiguration.ON,
308
>
'restricted': true,
309
>
'scope': ConfigurationScope.APPLICATION,
310
>
'tags': ['usesOnlineServices', 'telemetry'],
311
>
'policy': {
312
>
name: 'TelemetryLevel',
313
>
category: PolicyCategory.Telemetry,
314
>
minimumVersion: '1.99',
315
>
localization: {
316
>
description: {
317
>
key: 'telemetry.telemetryLevel.policyDescription',
318
>
value: localize('telemetry.telemetryLevel.policyDescription', "Controls the level of telemetry."),
319
>
},
320
>
enumDescriptions: [
321
>
{
322
>
key: 'telemetry.telemetryLevel.default',
323
>
value: localize('telemetry.telemetryLevel.default', "Sends usage data, errors, and crash reports."),
324
>
},
325
>
{
326
>
key: 'telemetry.telemetryLevel.error',
327
>
value: localize('telemetry.telemetryLevel.error', "Sends general error telemetry and crash reports."),
328
>
},
329
>
{
330
>
key: 'telemetry.telemetryLevel.crash',
331
>
value: localize('telemetry.telemetryLevel.crash', "Sends OS level crash reports."),
332
>
},
333
>
{
334
>
key: 'telemetry.telemetryLevel.off',
335
>
value: localize('telemetry.telemetryLevel.off', "Disables all product telemetry."),
336
>
}
337
>
]
338
>
}
339
>
}
340
>
},
341
>
'telemetry.feedback.enabled': {
342
>
type: 'boolean',
343
>
default: true,
344
>
description: localize('telemetry.feedback.enabled', "Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."),
345
>
policy: {
346
>
name: 'EnableFeedback',
347
>
category: PolicyCategory.Telemetry,
348
>
minimumVersion: '1.99',
349
>
localization: { description: { key: 'telemetry.feedback.enabled', value: localize('telemetry.feedback.enabled', "Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options.") } },
350
>
}
351
>
},
352
>
// Deprecated telemetry setting
353
>
[TELEMETRY_OLD_SETTING_ID]: {
354
>
'type': 'boolean',
355
>
'markdownDescription':
356
>
!product.privacyStatementUrl ?
357
>
localize('telemetry.enableTelemetry', "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made.", product.nameLong) :
358
localize('telemetry.enableTelemetryMd', "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made. [Read more]({1}) about what we collect and our privacy statement.", product.nameLong, product.privacyStatementUrl),
360
>
'restricted': true,
361
>
'markdownDeprecationMessage': localize('enableTelemetryDeprecated', "If this setting is false, no telemetry will be sent regardless of the new setting's value. Deprecated in favor of the {0} setting.", `\`#${TELEMETRY_SETTING_ID}#\``),
362
>
'scope': ConfigurationScope.APPLICATION,
363
>
'tags': ['usesOnlineServices', 'telemetry']
364
>
}
365
>
},
366
>
});