src/vs/platform/log/common/bufferLog.ts/getLogFunction
function getLogFunction(logger: ILogger, level: LogLevel): Function {
	switch (level) {
		case LogLevel.Trace: return logger.trace;
		case LogLevel.Debug: return logger.debug;
		case LogLevel.Info: return logger.info;
		case LogLevel.Warning: return logger.warn;
		case LogLevel.Error: return logger.error;
		case LogLevel.Critical: return logger.critical;
		default: throw new Error('Invalid log level');
	}
}