本文整理汇总了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)
});
}
});
示例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);
}
});
}
示例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();
}
});
示例4:
return lifecycleService.onShutdown(event => {
/* __GDPR__
"shutdown" : {
"reason" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
telemetryService.publicLog('shutdown', { reason: ShutdownReason[event] });
});
示例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;
}
示例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);
}
}));
示例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
}))
});
}
});
示例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);
}
示例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)
});
}
});
示例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
}))
});
}
});