當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ITelemetryService.publicLog方法代碼示例

本文整理匯總了TypeScript中vs/platform/telemetry/common/telemetry.ITelemetryService.publicLog方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ITelemetryService.publicLog方法的具體用法?TypeScript ITelemetryService.publicLog怎麽用?TypeScript ITelemetryService.publicLog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vs/platform/telemetry/common/telemetry.ITelemetryService的用法示例。


在下文中一共展示了ITelemetryService.publicLog方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: flattenKeys

	return configurationService.onDidUpdateConfiguration(event => {
		if (event.source !== ConfigurationSource.Default) {
			telemetryService.publicLog('updateConfiguration', {
				configurationSource: ConfigurationSource[event.source],
				configurationKeys: flattenKeys(event.sourceConfig)
			});
			telemetryService.publicLog('updateConfigurationValues', {
				configurationSource: ConfigurationSource[event.source],
				configurationValues: flattenValues(event.sourceConfig, configurationValueWhitelist)
			});
		}
	});
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:12,代碼來源:telemetryUtils.ts

示例2: triggerAndDisposeAction

export function triggerAndDisposeAction(instantitationService: IInstantiationService, telemetryService: ITelemetryService, partService: IPartService, descriptor: SyncActionDescriptor, args: any): TPromise<any> {
	let actionInstance = instantitationService.createInstance(descriptor.syncDescriptor);
	actionInstance.label = descriptor.label || actionInstance.label;

	// don't run the action when not enabled
	if (!actionInstance.enabled) {
		actionInstance.dispose();

		return void 0;
	}

	const from = args && args.from || 'keybinding';
	if (telemetryService) {
		telemetryService.publicLog('workbenchActionExecuted', { id: actionInstance.id, from });
	}

	// run action when workbench is created
	return partService.joinCreation().then(() => {
		try {
			return TPromise.as(actionInstance.run(undefined, { from })).then(() => {
				actionInstance.dispose();
			}, (err) => {
				actionInstance.dispose();
				return TPromise.wrapError(err);
			});
		} catch (err) {
			actionInstance.dispose();
			return TPromise.wrapError(err);
		}
	});
}
開發者ID:naturtle,項目名稱:vscode,代碼行數:31,代碼來源:actionRegistry.ts

示例3: catch

	return new Promise<void>(resolve => {
		try {
			let telData: ITelemetryData = data === undefined ? {} : data;

			if (telData && telData.provider === undefined) {

				let provider: string = '';
				if (connection) {
					provider = connection.providerName;
				}
				telData.provider = provider;
			}
			delete telData['connection'];
			if (telemetryService) {
				telemetryService.publicLog(telemetryEventName, telData).then(() => {
					resolve();
				}, telemetryServiceError => {
					warn(`Failed to add telemetry. error: ${telemetryServiceError}`);
					resolve();
				});
			} else {
				resolve();
			}
		} catch (error) {
			warn(`Failed to add telemetry. error: ${error}`);
			resolve();
		}
	});
開發者ID:AlexxNica,項目名稱:sqlopsstudio,代碼行數:28,代碼來源:telemetryUtilities.ts

示例4:

	return lifecycleService.onShutdown(event => {
		/* __GDPR__
		   "shutdown" : {
			  "reason" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
		   }
		 */
		telemetryService.publicLog('shutdown', { reason: ShutdownReason[event] });
	});
開發者ID:kieferrm,項目名稱:vscode,代碼行數:8,代碼來源:telemetryUtils.ts

示例5: _dispatch

	protected _dispatch(e: IKeyboardEvent, target: IContextKeyServiceTarget): boolean {
		let shouldPreventDefault = false;

		const keybinding = this.resolveKeyboardEvent(e);
		if (keybinding.isChord()) {
			console.warn('Unexpected keyboard event mapped to a chord');
			return null;
		}
		const [firstPart,] = keybinding.getDispatchParts();
		if (firstPart === null) {
			// cannot be dispatched, probably only modifier keys
			return shouldPreventDefault;
		}

		const contextValue = this._contextKeyService.getContext(target);
		const currentChord = this._currentChord ? this._currentChord.keypress : null;
		const keypressLabel = keybinding.getLabel();
		const resolveResult = this._getResolver().resolve(contextValue, currentChord, firstPart);

		if (resolveResult && resolveResult.enterChord) {
			shouldPreventDefault = true;
			this._enterChordMode(firstPart, keypressLabel);
			return shouldPreventDefault;
		}

		if (this._statusService && this._currentChord) {
			if (!resolveResult || !resolveResult.commandId) {
				this._statusService.setStatusMessage(nls.localize('missing.chord', "The key combination ({0}, {1}) is not a command.", this._currentChord.label, keypressLabel), 10 * 1000 /* 10s */);
				shouldPreventDefault = true;
			}
		}

		this._leaveChordMode();

		if (resolveResult && resolveResult.commandId) {
			if (!resolveResult.bubble) {
				shouldPreventDefault = true;
			}
			if (typeof resolveResult.commandArgs === 'undefined') {
				this._commandService.executeCommand(resolveResult.commandId).then(undefined, err => this._notificationService.warn(err));
			} else {
				this._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs).then(undefined, err => this._notificationService.warn(err));
			}
			/* __GDPR__
				"workbenchActionExecuted" : {
					"id" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
					"from": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
				}
			*/
			this._telemetryService.publicLog('workbenchActionExecuted', { id: resolveResult.commandId, from: 'keybinding' });
		}

		return shouldPreventDefault;
	}
開發者ID:ramesius,項目名稱:vscode,代碼行數:54,代碼來源:abstractKeybindingService.ts

示例6:

		this.toDispose.push(this.actionRunner.addListener2(EventType.BEFORE_RUN, (e: any) => {
			if (this.telemetryService) {
				this.telemetryService.publicLog('workbenchActionExecuted', { id: e.action.id, from: 'contextMenu' });
			}

			hideViewOnRun = !!e.retainActionItem;

			if (!hideViewOnRun) {
				this.contextViewService.hideContextView(false);
			}
		}));
開發者ID:1Hgm,項目名稱:vscode,代碼行數:11,代碼來源:contextMenuHandler.ts

示例7:

	return keybindingService.onDidUpdateKeybindings(event => {
		if (event.source === KeybindingSource.User && event.keybindings) {
			telemetryService.publicLog('updateKeybindings', {
				bindings: event.keybindings.map(binding => ({
					key: binding.key,
					command: binding.command,
					when: binding.when,
					args: binding.args ? true : undefined
				}))
			});
		}
	});
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:12,代碼來源:telemetryUtils.ts

示例8: onActionRun

	private onActionRun(e: IRunEvent): void {
		if (this.telemetryService) {
			/* __GDPR__
				"workbenchActionExecuted" : {
					"id" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
					"from": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
				}
			*/
			this.telemetryService.publicLog('workbenchActionExecuted', { id: e.action.id, from: 'contextMenu' });
		}

		this.contextViewService.hideContextView(false);
	}
開發者ID:burhandodhy,項目名稱:azuredatastudio,代碼行數:13,代碼來源:contextMenuHandler.ts

示例9: flattenKeys

	return configurationService.onDidChangeConfiguration(event => {
		if (event.source !== ConfigurationTarget.DEFAULT) {
			/* __GDPR__
				"updateConfiguration" : {
					"configurationSource" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
					"configurationKeys": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
				}
			*/
			telemetryService.publicLog('updateConfiguration', {
				configurationSource: ConfigurationTarget[event.source],
				configurationKeys: flattenKeys(event.sourceConfig)
			});
			/* __GDPR__
				"updateConfigurationValues" : {
					"configurationSource" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
					"configurationValues": { "classification": "CustomerContent", "purpose": "FeatureInsight" }
				}
			*/
			telemetryService.publicLog('updateConfigurationValues', {
				configurationSource: ConfigurationTarget[event.source],
				configurationValues: flattenValues(event.sourceConfig, configurationValueWhitelist)
			});
		}
	});
開發者ID:AllureFer,項目名稱:vscode,代碼行數:24,代碼來源:telemetryUtils.ts

示例10:

	return keybindingService.onDidUpdateKeybindings(event => {
		if (event.source === KeybindingSource.User && event.keybindings) {
			/* __GDPR__
				"updateKeybindings" : {
					"bindings": { "classification": "CustomerContent", "purpose": "FeatureInsight" }
				}
			*/
			telemetryService.publicLog('updateKeybindings', {
				bindings: event.keybindings.map(binding => ({
					key: binding.key,
					command: binding.command,
					when: binding.when,
					args: binding.args ? true : undefined
				}))
			});
		}
	});
開發者ID:AllureFer,項目名稱:vscode,代碼行數:17,代碼來源:telemetryUtils.ts


注:本文中的vs/platform/telemetry/common/telemetry.ITelemetryService.publicLog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。