@@ -43,7 +43,6 @@ use tokio::{
4343 sync:: oneshot,
4444 task:: JoinHandle ,
4545} ;
46- use tracing:: { error, info, warn} ;
4746
4847use crate :: {
4948 cli:: command:: BenchmarkCommand ,
@@ -486,10 +485,10 @@ impl ClientWrapper {
486485 . send ( )
487486 . await ;
488487 if request. is_ok ( ) {
489- info ! ( "Node service has started" ) ;
488+ tracing :: info!( "Node service has started" ) ;
490489 return Ok ( NodeService :: new ( port, child) ) ;
491490 } else {
492- warn ! ( "Waiting for node service to start" ) ;
491+ tracing :: warn!( "Waiting for node service to start" ) ;
493492 }
494493 }
495494 bail ! ( "Failed to start node service" ) ;
@@ -568,10 +567,10 @@ impl ClientWrapper {
568567 . send ( )
569568 . await ;
570569 if request. is_ok ( ) {
571- info ! ( "Faucet has started" ) ;
570+ tracing :: info!( "Faucet has started" ) ;
572571 return Ok ( FaucetService :: new ( port, child, temp_dir) ) ;
573572 } else {
574- warn ! ( "Waiting for faucet to start" ) ;
573+ tracing :: debug !( "Waiting for faucet to start" ) ;
575574 }
576575 }
577576 bail ! ( "Failed to start faucet" ) ;
@@ -1120,7 +1119,7 @@ impl ClientWrapper {
11201119
11211120 let contract_size = fs_err:: tokio:: metadata ( & contract) . await ?. len ( ) ;
11221121 let service_size = fs_err:: tokio:: metadata ( & service) . await ?. len ( ) ;
1123- info ! ( "Done building application {name}: contract_size={contract_size}, service_size={service_size}" ) ;
1122+ tracing :: info!( "Done building application {name}: contract_size={contract_size}, service_size={service_size}" ) ;
11241123
11251124 Ok ( ( contract, service) )
11261125 }
@@ -1135,12 +1134,14 @@ impl Drop for ClientWrapper {
11351134 }
11361135
11371136 let Ok ( binary_path) = self . binary_path . lock ( ) else {
1138- error ! ( "Failed to close chains because a thread panicked with a lock to `binary_path`" ) ;
1137+ tracing:: error!(
1138+ "Failed to close chains because a thread panicked with a lock to `binary_path`"
1139+ ) ;
11391140 return ;
11401141 } ;
11411142
11421143 let Some ( binary_path) = binary_path. as_ref ( ) else {
1143- warn ! (
1144+ tracing :: warn!(
11441145 "Assuming no chains need to be closed, because the command binary was never \
11451146 resolved and therefore presumably never called"
11461147 ) ;
@@ -1159,17 +1160,17 @@ impl Drop for ClientWrapper {
11591160 . args ( [ "wallet" , "show" , "--short" , "--owned" ] )
11601161 . output ( )
11611162 else {
1162- warn ! ( "Failed to execute `wallet show --short` to list chains to close" ) ;
1163+ tracing :: warn!( "Failed to execute `wallet show --short` to list chains to close" ) ;
11631164 return ;
11641165 } ;
11651166
11661167 if !wallet_show_output. status . success ( ) {
1167- warn ! ( "Failed to list chains in the wallet to close them" ) ;
1168+ tracing :: warn!( "Failed to list chains in the wallet to close them" ) ;
11681169 return ;
11691170 }
11701171
11711172 let Ok ( chain_list_string) = String :: from_utf8 ( wallet_show_output. stdout ) else {
1172- warn ! (
1173+ tracing :: warn!(
11731174 "Failed to close chains because `linera wallet show --short` \
11741175 returned a non-UTF-8 output"
11751176 ) ;
@@ -1192,8 +1193,8 @@ impl Drop for ClientWrapper {
11921193
11931194 match close_chain_command. args ( [ "close-chain" , chain_id] ) . status ( ) {
11941195 Ok ( status) if status. success ( ) => ( ) ,
1195- Ok ( failure) => warn ! ( "Failed to close chain {chain_id}: {failure}" ) ,
1196- Err ( error) => warn ! ( "Failed to close chain {chain_id}: {error}" ) ,
1196+ Ok ( failure) => tracing :: warn!( "Failed to close chain {chain_id}: {failure}" ) ,
1197+ Err ( error) => tracing :: warn!( "Failed to close chain {chain_id}: {error}" ) ,
11971198 }
11981199 }
11991200 }
@@ -1412,7 +1413,7 @@ impl NodeService {
14121413 . send ( )
14131414 . await ;
14141415 if matches ! ( result, Err ( ref error) if error. is_timeout( ) ) {
1415- warn ! (
1416+ tracing :: warn!(
14161417 "Timeout when sending query {} to the node service" ,
14171418 truncate_query_output( query)
14181419 ) ;
@@ -1435,7 +1436,7 @@ impl NodeService {
14351436 ) ;
14361437 let value: Value = response. json ( ) . await . context ( "invalid JSON" ) ?;
14371438 if let Some ( errors) = value. get ( "errors" ) {
1438- warn ! (
1439+ tracing :: warn!(
14391440 "Query \" {}\" failed: {}" ,
14401441 truncate_query_output( query) ,
14411442 errors
@@ -1617,7 +1618,7 @@ impl<A> ApplicationWrapper<A> {
16171618 let response = match result {
16181619 Ok ( response) => response,
16191620 Err ( error) if i < MAX_RETRIES => {
1620- warn ! (
1621+ tracing :: warn!(
16211622 "Failed to post query \" {}\" : {error}; retrying" ,
16221623 truncate_query_output_serialize( & query) ,
16231624 ) ;
0 commit comments