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


TypeScript log.ILogService類代碼示例

本文整理匯總了TypeScript中vs/platform/log/common/log.ILogService的典型用法代碼示例。如果您正苦於以下問題:TypeScript ILogService類的具體用法?TypeScript ILogService怎麽用?TypeScript ILogService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: getShellEnvironment

export function getShellEnvironment(logService: ILogService): Promise<typeof process.env> {
	if (_shellEnv === undefined) {
		if (isWindows) {
			logService.trace('getShellEnvironment: runing on windows, skipping');
			_shellEnv = Promise.resolve({});
		} else if (process.env['VSCODE_CLI'] === '1') {
			logService.trace('getShellEnvironment: runing on CLI, skipping');
			_shellEnv = Promise.resolve({});
		} else {
			logService.trace('getShellEnvironment: running on Unix');
			_shellEnv = getUnixShellEnvironment(logService);
		}
	}

	return _shellEnv;
}
開發者ID:fly-fisher,項目名稱:vscode,代碼行數:16,代碼來源:shellEnv.ts

示例2: createStorageService

	private async createStorageService(payload: IWorkspaceInitializationPayload, environmentService: IWorkbenchEnvironmentService, logService: ILogService, mainProcessService: IMainProcessService): Promise<StorageService> {
		const globalStorageDatabase = new GlobalStorageDatabaseChannelClient(mainProcessService.getChannel('storage'));
		const storageService = new StorageService(globalStorageDatabase, logService, environmentService);

		try {
			await storageService.initialize(payload);

			return storageService;
		} catch (error) {
			onUnexpectedError(error);
			logService.error(error);

			return storageService;
		}
	}
開發者ID:PKRoma,項目名稱:vscode,代碼行數:15,代碼來源:main.ts

示例3: createWorkspaceService

	private async createWorkspaceService(payload: IWorkspaceInitializationPayload, environmentService: IWorkbenchEnvironmentService, fileService: FileService, remoteAgentService: IRemoteAgentService, logService: ILogService): Promise<WorkspaceService> {
		const configurationFileService = new ConfigurationFileService();
		configurationFileService.fileService = fileService;

		const workspaceService = new WorkspaceService({ userSettingsResource: environmentService.settingsResource, remoteAuthority: this.configuration.remoteAuthority, configurationCache: new ConfigurationCache(environmentService) }, configurationFileService, remoteAgentService);

		try {
			await workspaceService.initialize(payload);

			return workspaceService;
		} catch (error) {
			onUnexpectedError(error);
			logService.error(error);

			return workspaceService;
		}
	}
開發者ID:PKRoma,項目名稱:vscode,代碼行數:17,代碼來源:main.ts

示例4: Error

	call(_, command: string, arg?: any): Thenable<any> {
		switch (command) {
			case 'setLevel': this.service.setLevel(arg);
		}

		throw new Error(`Call not found: ${command}`);
	}
開發者ID:,項目名稱:,代碼行數:7,代碼來源:

示例5: Error

	call(_: unknown, command: string, arg?: any): Promise<any> {
		switch (command) {
			case 'setLevel': this.service.setLevel(arg); return Promise.resolve();
		}

		throw new Error(`Call not found: ${command}`);
	}
開發者ID:PKRoma,項目名稱:vscode,代碼行數:7,代碼來源:logIpc.ts

示例6: mkdirp

		zipfile.on('entry', (entry: Entry) => {
			logService.debug(targetPath, 'Found', entry.fileName);

			if (isCanceled) {
				return;
			}

			if (!options.sourcePathRegex.test(entry.fileName)) {
				readNextEntry();
				return;
			}

			const fileName = entry.fileName.replace(options.sourcePathRegex, '');

			// directory file names end with '/'
			if (/\/$/.test(fileName)) {
				const targetFileName = path.join(targetPath, fileName);
				last = mkdirp(targetFileName).then(() => readNextEntry());
				return;
			}

			const stream = ninvoke(zipfile, zipfile.openReadStream, entry);
			const mode = modeFromEntry(entry);

			last = throttler.queue(() => stream.then(stream => extractEntry(stream, fileName, mode, targetPath, options).then(() => readNextEntry())));
		});
開發者ID:jumpinjackie,項目名稱:sqlopsstudio,代碼行數:26,代碼來源:zip.ts

示例7: reject

		child.on('close', code => {
			if (code !== 0) {
				return reject(new Error('Failed to get environment'));
			}

			const raw = Buffer.concat(buffers).toString('utf8');
			logService.trace('getUnixShellEnvironment#raw', raw);

			const match = regex.exec(raw);
			const rawStripped = match ? match[1] : '{}';

			try {
				const env = JSON.parse(rawStripped);

				if (runAsNode) {
					env['ELECTRON_RUN_AS_NODE'] = runAsNode;
				} else {
					delete env['ELECTRON_RUN_AS_NODE'];
				}

				if (noAttach) {
					env['ELECTRON_NO_ATTACH_CONSOLE'] = noAttach;
				} else {
					delete env['ELECTRON_NO_ATTACH_CONSOLE'];
				}

				// https://github.com/Microsoft/vscode/issues/22593#issuecomment-336050758
				delete env['XDG_RUNTIME_DIR'];

				logService.trace('getUnixShellEnvironment#result', env);
				resolve(env);
			} catch (err) {
				logService.error('getUnixShellEnvironment#error', err);
				reject(err);
			}
		});
開發者ID:PKRoma,項目名稱:vscode,代碼行數:36,代碼來源:shellEnv.ts

示例8:

		this._register(master.onDidChangeLogLevel(level => logService.setLevel(level)));
開發者ID:PKRoma,項目名稱:vscode,代碼行數:1,代碼來源:logIpc.ts

示例9:

	once(token.onCancellationRequested)(() => {
		logService.debug(targetPath, 'Cancelled.');
		last.cancel();
		zipfile.close();
	});
開發者ID:DonJayamanne,項目名稱:vscode,代碼行數:5,代碼來源:zip.ts

示例10:

		return storageService.initialize(payload).then(() => storageService, error => {
			onUnexpectedError(error);
			logService.error(error);

			return storageService;
		});
開發者ID:joelday,項目名稱:vscode,代碼行數:6,代碼來源:main.ts


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