src/vs/workbench/services/output/common/output.ts/registerLogChannel
export function registerLogChannel(id: string, label: string, file: URI, fileService: IFileService, logService: ILogService): CancelablePromise<void> {
	return createCancelablePromise(async token => {
		await whenProviderRegistered(file, fileService);
		const outputChannelRegistry = Registry.as<IOutputChannelRegistry>(Extensions.OutputChannels);
		try {
			await whenFileExists(file, 1, fileService, logService, token);
			outputChannelRegistry.registerChannel({ id, label, file, log: true });
		} catch (error) {
			if (!isCancellationError(error)) {
				logService.error('Error while registering log channel', file.toString(), getErrorMessage(error));
			}
		}
	});
}