function typeToLogLevel(annotationType) {
  const level = { error: 'error', warning: 'warn' }[annotationType];
  if (!level) {
    throw new Error(`Invalid annotation type: '${annotationType}'`);
  }
  return level;
}
Turns annotation type into a log level