Skip to content

Commit

Permalink
Allow multiple logs listeners (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
ademar111190 authored Oct 25, 2023
1 parent 45ed174 commit a51d814
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libs/sdk-flutter/lib/breez_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,17 @@ class BreezSDK {
_backupStreamController.addError(Exception(event.details.error));
}
});
_lnToolkit.breezLogStream().listen((logEntry) {
_logStreamController.add(logEntry);
}, onError: (e) {
_logStreamController.addError(e);
});
}

Stream<LogEntry> get logStream => _lnToolkit.breezLogStream();
final _logStreamController = StreamController<LogEntry>.broadcast();

/// Listen to log events
Stream<LogEntry> get logStream => _logStreamController.stream;

/* Breez Services API's & Streams*/

Expand Down

0 comments on commit a51d814

Please sign in to comment.