1
1
use std:: { future:: Future , sync:: Arc } ;
2
2
3
3
use bitcoincore_rpc:: RpcApi ;
4
+ use tracing:: { debug, info} ;
4
5
5
6
use super :: {
6
7
bitcoin:: BitcoinNodeCluster ,
@@ -119,13 +120,13 @@ impl TestFramework {
119
120
120
121
pub fn show_log_paths ( & self ) {
121
122
if self . show_logs {
122
- println ! (
123
+ info ! (
123
124
"Logs available at {}" ,
124
125
self . ctx. config. test_case. dir. display( )
125
126
) ;
126
127
127
128
for node in self . get_nodes_as_log_provider ( ) {
128
- println ! (
129
+ info ! (
129
130
"{} logs available at : {}" ,
130
131
node. kind( ) ,
131
132
node. log_path( ) . display( )
@@ -135,14 +136,14 @@ impl TestFramework {
135
136
}
136
137
137
138
pub fn dump_log ( & self ) -> Result < ( ) > {
138
- println ! ( "Dumping logs:" ) ;
139
+ debug ! ( "Dumping logs:" ) ;
139
140
140
141
let n_lines = std:: env:: var ( "TAIL_N_LINES" )
141
142
. ok ( )
142
143
. and_then ( |v| v. parse :: < usize > ( ) . ok ( ) )
143
144
. unwrap_or ( 25 ) ;
144
145
for node in self . get_nodes_as_log_provider ( ) {
145
- println ! ( "{} logs (last {n_lines} lines):" , node. kind( ) ) ;
146
+ debug ! ( "{} logs (last {n_lines} lines):" , node. kind( ) ) ;
146
147
if let Err ( e) = tail_file ( & node. log_path ( ) , n_lines) {
147
148
eprint ! ( "{e}" ) ;
148
149
}
@@ -151,34 +152,34 @@ impl TestFramework {
151
152
}
152
153
153
154
pub async fn stop ( & mut self ) -> Result < ( ) > {
154
- println ! ( "Stopping framework..." ) ;
155
+ info ! ( "Stopping framework..." ) ;
155
156
156
157
if let Some ( sequencer) = & mut self . sequencer {
157
158
let _ = sequencer. stop ( ) . await ;
158
- println ! ( "Successfully stopped sequencer" ) ;
159
+ info ! ( "Successfully stopped sequencer" ) ;
159
160
}
160
161
161
162
if let Some ( batch_prover) = & mut self . batch_prover {
162
163
let _ = batch_prover. stop ( ) . await ;
163
- println ! ( "Successfully stopped batch_prover" ) ;
164
+ info ! ( "Successfully stopped batch_prover" ) ;
164
165
}
165
166
166
167
if let Some ( light_client_prover) = & mut self . light_client_prover {
167
168
let _ = light_client_prover. stop ( ) . await ;
168
- println ! ( "Successfully stopped light_client_prover" ) ;
169
+ info ! ( "Successfully stopped light_client_prover" ) ;
169
170
}
170
171
171
172
if let Some ( full_node) = & mut self . full_node {
172
173
let _ = full_node. stop ( ) . await ;
173
- println ! ( "Successfully stopped full_node" ) ;
174
+ info ! ( "Successfully stopped full_node" ) ;
174
175
}
175
176
176
177
let _ = self . bitcoin_nodes . stop_all ( ) . await ;
177
- println ! ( "Successfully stopped bitcoin nodes" ) ;
178
+ info ! ( "Successfully stopped bitcoin nodes" ) ;
178
179
179
180
if let Some ( docker) = self . ctx . docker . as_ref ( ) {
180
181
let _ = docker. cleanup ( ) . await ;
181
- println ! ( "Successfully cleaned docker" ) ;
182
+ info ! ( "Successfully cleaned docker" ) ;
182
183
}
183
184
184
185
Ok ( ( ) )
0 commit comments