mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-18 08:45:05 +00:00
enable breez logging
This commit is contained in:
parent
7f629f9f1b
commit
88a97aa8b2
1 changed files with 16 additions and 4 deletions
|
@ -95,6 +95,7 @@ abstract class LightningWalletBase extends ElectrumWallet with Store {
|
||||||
late final ObservableMap<CryptoCurrency, LightningBalance> _balance;
|
late final ObservableMap<CryptoCurrency, LightningBalance> _balance;
|
||||||
StreamSubscription<List<Payment>>? _paymentsSub;
|
StreamSubscription<List<Payment>>? _paymentsSub;
|
||||||
StreamSubscription<NodeState?>? _nodeStateSub;
|
StreamSubscription<NodeState?>? _nodeStateSub;
|
||||||
|
StreamSubscription<LogEntry>? _logStream;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@computed
|
@computed
|
||||||
|
@ -183,8 +184,23 @@ abstract class LightningWalletBase extends ElectrumWallet with Store {
|
||||||
await setupBreez(await Mnemonic.toSeed(mnemonic));
|
await setupBreez(await Mnemonic.toSeed(mnemonic));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _logSdkEntries(LogEntry entry) {
|
||||||
|
switch (entry.level) {
|
||||||
|
case "ERROR":
|
||||||
|
case "WARN":
|
||||||
|
case "INFO":
|
||||||
|
// case "DEBUG":
|
||||||
|
// case "TRACE":
|
||||||
|
print("BREEZ:${entry.level}: ${entry.line}");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> setupBreez(Uint8List seedBytes) async {
|
Future<void> setupBreez(Uint8List seedBytes) async {
|
||||||
final sdk = await BreezSDK();
|
final sdk = await BreezSDK();
|
||||||
|
_logStream?.cancel();
|
||||||
|
_logStream = sdk.logStream.listen(_logSdkEntries);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!(await sdk.isInitialized())) {
|
if (!(await sdk.isInitialized())) {
|
||||||
sdk.initialize();
|
sdk.initialize();
|
||||||
|
@ -194,10 +210,6 @@ abstract class LightningWalletBase extends ElectrumWallet with Store {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sdk.logStream.listen((LogEntry event) {
|
|
||||||
// print("Breez log: ${event.line}");
|
|
||||||
// });
|
|
||||||
|
|
||||||
GreenlightCredentials greenlightCredentials = GreenlightCredentials(
|
GreenlightCredentials greenlightCredentials = GreenlightCredentials(
|
||||||
developerKey: base64.decode(secrets.greenlightKey),
|
developerKey: base64.decode(secrets.greenlightKey),
|
||||||
developerCert: base64.decode(secrets.greenlightCert),
|
developerCert: base64.decode(secrets.greenlightCert),
|
||||||
|
|
Loading…
Reference in a new issue