src/vs/workbench/api/common/extHostOutput.ts/ExtHostOutputService/logLevel
class ExtHostOutputService:	private createExtHostLogOutputChannel(name: string, logLevel: LogLevel, channelPromise: Promise<ExtHostOutputChannel>): vscode.LogOutputChannel {
		const disposables = new DisposableStore();
		const validate = () => {
			if (disposables.isDisposed) {
				throw new Error('Channel has been closed');
			}
		};
		const onDidChangeLogLevel = disposables.add(new Emitter<LogLevel>());
		channelPromise.then(channel => {
			disposables.add(channel);
			disposables.add(channel.onDidChangeLogLevel(e => {
				logLevel = e;
				onDidChangeLogLevel.fire(e);
			}));
		});
		return {
			...this.createExtHostOutputChannel(name, channelPromise),
			get logLevel() { return logLevel; },
			onDidChangeLogLevel: onDidChangeLogLevel.event,
			trace(value: string, ...args: any[]): void {
				validate();
				channelPromise.then(channel => channel.trace(value, ...args));
			},
			debug(value: string, ...args: any[]): void {
				validate();
				channelPromise.then(channel => channel.debug(value, ...args));
			},
			info(value: string, ...args: any[]): void {
				validate();
				channelPromise.then(channel => channel.info(value, ...args));
			},
			warn(value: string, ...args: any[]): void {
				validate();
				channelPromise.then(channel => channel.warn(value, ...args));
			},
			error(value: Error | string, ...args: any[]): void {
				validate();
				channelPromise.then(channel => channel.error(value, ...args));
			},
			dispose(): void {
				disposables.dispose();
			}
		};
	}