dvLogXRDiagnostic function

void dvLogXRDiagnostic(
  1. String code,
  2. String message,
  3. Map<String, Object?> context
)

Logs code at the level the diagnostic registry assigns it.

Implementation

void dvLogXRDiagnostic(String code, String message, Map<String, Object?> context) {
  final String level = DVDiagnostics.find(code)?.level ?? 'warning';
  DVObservability.log(
    '$code: $message',
    level: switch (level) {
      'debug' => DVLogLevel.debug,
      'info' => DVLogLevel.info,
      'error' => DVLogLevel.error,
      _ => DVLogLevel.warn,
    },
    code: code,
    context: context,
  );
}