export type ObservabilityDiagnostic = (message: string, error: unknown) => void;

/** Report exporter failures without feeding them back through the exporter. */
export function reportObservabilityFailure(
  message: string,
  error: unknown,
  diagnostic?: ObservabilityDiagnostic,
): void {
  if (diagnostic) {
    diagnostic(message, error);
    return;
  }
  console.warn(`[wrnexus:observability] ${message}`, error);
}
