function annotationToLoggerInfo(
  apiDescriptionLocation,
  annotation,
) {
  const level = typeToLogLevel(annotation.type);

  if (annotation.component === 'apiDescriptionParser') {
    const message =
      `${formatComponent(annotation.component)} ${annotation.type}` +
      ` in ${formatLocation(apiDescriptionLocation, annotation.location)}:` +
      ` ${annotation.message}`;
    return { level, message };
  }

  // See https://github.com/apiaryio/dredd-transactions/issues/275 why this
  // is handled in a different way than parser annotations
  const message =
    `${formatComponent(annotation.component)} ${annotation.type}` +
    ` in ${apiDescriptionLocation} (${compileTransactionName(
      annotation.origin,
    )}):` +
    ` ${annotation.message}`;
  return { level, message };
}
Takes API description parser or compiler annotation returned from
the 'dredd-transactions' library and transforms it into a message
Dredd can show to the user. Returns an object logger accepts as input.

@param {string} apiDescriptionLocation API description location name
@param {Object} annotation the annotation object from Dredd Transactions
@return {LoggerInfo}