mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
no need to check isUsageEnabled and isErrorsEnabled that is auto-checked
This commit is contained in:
@ -21,18 +21,14 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
|
||||
const c1 = vscode.commands.registerCommand('extension.logEvent', () => {
|
||||
vscode.window.showInformationMessage('Logged telemetry event!');
|
||||
if (logger.isUsageEnabled) {
|
||||
logger.logUsage('testEvent', { 'testProp': 'testValue' });
|
||||
}
|
||||
logger.logUsage('testEvent', { 'testProp': 'testValue' });
|
||||
});
|
||||
|
||||
context.subscriptions.push(c1);
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('extension.logException', () => {
|
||||
vscode.window.showInformationMessage('Logged telemetry exception!');
|
||||
if (logger.isErrorsEnabled) {
|
||||
logger.logError(new Error('Test'), { 'testProp': 'testValue' });
|
||||
logger.logError('testerror', { 'testProp': 'testValue' });
|
||||
}
|
||||
logger.logError(new Error('Test'), { 'testProp': 'testValue' });
|
||||
logger.logError('testerror', { 'testProp': 'testValue' });
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user