function logDiagnostics()

in src/handler.ts [573:594]


function logDiagnostics(diagnostics: DeploymentDiagnosticsDefinition[]) {
  if (diagnostics.length === 0) {
    return;
  }

  logInfo("Diagnostics returned by the API");

  for (const diagnostic of diagnostics) {
    const message = `[${diagnostic.level}] ${diagnostic.code}: ${diagnostic.message}`;
    switch (diagnostic.level.toLowerCase()) {
      case "error":
        logError(message);
        break;
      case "warning":
        logWarning(message);
        break;
      default:
        logInfo(message);
        break;
    }
  }
}