dvLogCrashDiagnostic function
Logs a DV-CRASH diagnostic at the level the registry gives it.
Implementation
void dvLogCrashDiagnostic(String code, String message) {
final String level = DVDiagnostics.all
.where((DVDiagnostic d) => d.code == code)
.firstOrNull
?.level ??
'warning';
_crashLogger.log(
'$code: $message',
level: switch (level) {
'debug' => DVLogLevel.debug,
'info' => DVLogLevel.info,
'error' => DVLogLevel.error,
_ => DVLogLevel.warn,
},
context: <String, Object?>{'code': code},
);
}