@@ -30,7 +30,6 @@ use crate::types::Update;
30
30
use crate :: wallet:: Wallet ;
31
31
use crate :: FeeRate ;
32
32
33
- type LogLevel = bdk_kyoto:: kyoto:: LogLevel ;
34
33
type NodeState = bdk_kyoto:: NodeState ;
35
34
type ScanType = bdk_kyoto:: ScanType ;
36
35
@@ -53,7 +52,6 @@ pub struct CbfComponents {
53
52
#[ derive( Debug , uniffi:: Object ) ]
54
53
pub struct CbfClient {
55
54
sender : Arc < Requester > ,
56
- log_rx : Mutex < Receiver < String > > ,
57
55
info_rx : Mutex < Receiver < bdk_kyoto:: Info > > ,
58
56
warning_rx : Mutex < UnboundedReceiver < bdk_kyoto:: Warning > > ,
59
57
update_rx : Mutex < UpdateSubscriber > ,
@@ -105,7 +103,6 @@ pub struct CbfBuilder {
105
103
response_timeout : Duration ,
106
104
data_dir : Option < String > ,
107
105
scan_type : ScanType ,
108
- log_level : LogLevel ,
109
106
dns_resolver : Option < Arc < IpAddress > > ,
110
107
socks5_proxy : Option < Socks5Proxy > ,
111
108
peers : Vec < Peer > ,
@@ -122,7 +119,6 @@ impl CbfBuilder {
122
119
response_timeout : MESSAGE_RESPONSE_TIMEOUT ,
123
120
data_dir : None ,
124
121
scan_type : ScanType :: default ( ) ,
125
- log_level : LogLevel :: default ( ) ,
126
122
dns_resolver : None ,
127
123
socks5_proxy : None ,
128
124
peers : Vec :: new ( ) ,
@@ -154,15 +150,6 @@ impl CbfBuilder {
154
150
} )
155
151
}
156
152
157
- /// Set the log level for the node. Production applications may want to omit `Debug` messages
158
- /// to avoid heap allocations.
159
- pub fn log_level ( & self , log_level : LogLevel ) -> Arc < Self > {
160
- Arc :: new ( CbfBuilder {
161
- log_level,
162
- ..self . clone ( )
163
- } )
164
- }
165
-
166
153
/// Bitcoin full-nodes to attempt a connection with.
167
154
pub fn peers ( & self , peers : Vec < Peer > ) -> Arc < Self > {
168
155
Arc :: new ( CbfBuilder {
@@ -220,7 +207,6 @@ impl CbfBuilder {
220
207
. data_dir ( path_buf)
221
208
. handshake_timeout ( self . handshake_timeout )
222
209
. response_timeout ( self . response_timeout )
223
- . log_level ( self . log_level )
224
210
. add_peers ( trusted_peers) ;
225
211
226
212
if let Some ( ip_addr) = self . dns_resolver . clone ( ) . map ( |ip| ip. inner ) {
@@ -235,7 +221,6 @@ impl CbfBuilder {
235
221
236
222
let BDKLightClient {
237
223
requester,
238
- log_subscriber,
239
224
info_subscriber,
240
225
warning_subscriber,
241
226
update_subscriber,
@@ -255,7 +240,6 @@ impl CbfBuilder {
255
240
256
241
let client = CbfClient {
257
242
sender : Arc :: new ( requester) ,
258
- log_rx : Mutex :: new ( log_subscriber) ,
259
243
info_rx : Mutex :: new ( info_subscriber) ,
260
244
warning_rx : Mutex :: new ( warning_subscriber) ,
261
245
update_rx : Mutex :: new ( update_subscriber) ,
@@ -271,12 +255,7 @@ impl CbfBuilder {
271
255
272
256
#[ uniffi:: export]
273
257
impl CbfClient {
274
- /// Return the next available log message from a node. If none is returned, the node has stopped.
275
- pub async fn next_log ( & self ) -> Result < String , CbfError > {
276
- let mut log_rx = self . log_rx . lock ( ) . await ;
277
- log_rx. recv ( ) . await . ok_or ( CbfError :: NodeStopped )
278
- }
279
-
258
+ /// Return the next available info message from a node. If none is returned, the node has stopped.
280
259
pub async fn next_info ( & self ) -> Result < Info , CbfError > {
281
260
let mut info_rx = self . info_rx . lock ( ) . await ;
282
261
info_rx
@@ -495,19 +474,6 @@ impl From<Warn> for Warning {
495
474
}
496
475
}
497
476
498
- /// Select the category of messages for the node to emit.
499
- #[ uniffi:: remote( Enum ) ]
500
- pub enum LogLevel {
501
- /// Send string messages. These messages are intended for debugging or troubleshooting
502
- /// node operation.
503
- Debug ,
504
- /// Send info and warning messages, but omit debug strings - including their memory allocations.
505
- /// Ideal for a production application that uses minimal logging.
506
- Info ,
507
- /// Omit debug strings and info messages, including their memory allocations.
508
- Warning ,
509
- }
510
-
511
477
/// The state of the node with respect to connected peers.
512
478
#[ uniffi:: remote( Enum ) ]
513
479
pub enum NodeState {
0 commit comments