src/vs/workbench/services/output/common/output.ts/whenFileExists
async function whenFileExists(file: URI, trial: number, fileService: IFileService, logService: ILogService, token: CancellationToken): Promise<void> {
	const exists = await fileService.exists(file);
	if (exists) {
		return;
	}
	if (token.isCancellationRequested) {
		throw new CancellationError();
	}
	if (trial > 10) {
		throw new Error(`Timed out while waiting for file to be created`);
	}
	logService.debug(`[Registering Log Channel] File does not exist. Waiting for 1s to retry.`, file.toString());
	await timeout(1000, token);
	await whenFileExists(file, trial + 1, fileService, logService, token);
}