runtimeLogStream method

Stream<Map<String, dynamic>>? runtimeLogStream()

Returns a broadcast stream of runtime log events via EventChannel.

Events are pushed from the native SdkLogger listener in real time. All entries are pre-redacted by SdkLogRedactor before crossing the bridge. Returns null if the EventChannel is not available.

The stream is cached — multiple listeners share the same underlying EventChannel subscription.

Implementation

Stream<Map<String, dynamic>>? runtimeLogStream() {
  try {
    _logStream ??= _logEventChannel
        .receiveBroadcastStream()
        .where((event) => event is Map)
        .map((event) => Map<String, dynamic>.from(event as Map));
    return _logStream;
  } catch (_) {
    return null;
  }
}