dvLogAnalyticsDiagnostic function
Logs an analytics diagnostic at the level the registry gives its code.
Implementation
void dvLogAnalyticsDiagnostic(String code, String message) {
final String level = DVDiagnostics.all
.where((DVDiagnostic d) => d.code == code)
.firstOrNull
?.level ??
'warning';
_analyticsLogger.log(
'$code: $message',
level: switch (level) {
'debug' => DVLogLevel.debug,
'info' => DVLogLevel.info,
'error' => DVLogLevel.error,
_ => DVLogLevel.warn,
},
context: <String, Object?>{'code': code},
);
}