dvLogProtocolDiagnostic function

void dvLogProtocolDiagnostic(
  1. String code,
  2. String message
)

The default diagnostic sink: the log, at the level the registry assigns.

Implementation

void dvLogProtocolDiagnostic(String code, String message) {
  final String level = DVDiagnostics.find(code)?.level ?? 'warning';
  _protocolLogger.log(
    '$code: $message',
    level: switch (level) {
      'debug' => DVLogLevel.debug,
      'info' => DVLogLevel.info,
      'error' => DVLogLevel.error,
      _ => DVLogLevel.warn,
    },
  );
}