@@ -67,16 +67,18 @@ impl<B: BlockT> InformantDisplay<B> {
6767 self . last_update = Instant :: now ( ) ;
6868 self . last_number = Some ( best_number) ;
6969
70- let ( status, target) = match ( net_status. sync_state , net_status. best_seen_block ) {
71- ( SyncState :: Idle , _) => ( "💤 Idle" . into ( ) , "" . into ( ) ) ,
72- ( SyncState :: Downloading , None ) => ( format ! ( "⚙️ Preparing{}" , speed) , "" . into ( ) ) ,
73- ( SyncState :: Downloading , Some ( n) ) => ( format ! ( "⚙️ Syncing{}" , speed) , format ! ( ", target=#{}" , n) ) ,
70+ let ( level , status, target) = match ( net_status. sync_state , net_status. best_seen_block ) {
71+ ( SyncState :: Idle , _) => ( "💤" , " Idle". into ( ) , "" . into ( ) ) ,
72+ ( SyncState :: Downloading , None ) => ( "⚙️ " , format ! ( " Preparing{}", speed) , "" . into ( ) ) ,
73+ ( SyncState :: Downloading , Some ( n) ) => ( "⚙️ " , format ! ( " Syncing{}", speed) , format ! ( ", target=#{}" , n) ) ,
7474 } ;
7575
76- if self . format == OutputFormat :: Coloured {
77- info ! (
76+ match & self . format {
77+ OutputFormat :: Coloured { prefix } => info ! (
7878 target: "substrate" ,
79- "{}{} ({} peers), best: #{} ({}), finalized #{} ({}), {} {}" ,
79+ "{} {}{}{} ({} peers), best: #{} ({}), finalized #{} ({}), {} {}" ,
80+ level,
81+ prefix,
8082 Colour :: White . bold( ) . paint( & status) ,
8183 target,
8284 Colour :: White . bold( ) . paint( format!( "{}" , num_connected_peers) ) ,
@@ -86,11 +88,12 @@ impl<B: BlockT> InformantDisplay<B> {
8688 info. chain. finalized_hash,
8789 Colour :: Green . paint( format!( "⬇ {}" , TransferRateFormat ( net_status. average_download_per_sec) ) ) ,
8890 Colour :: Red . paint( format!( "⬆ {}" , TransferRateFormat ( net_status. average_upload_per_sec) ) ) ,
89- ) ;
90- } else {
91- info ! (
91+ ) ,
92+ OutputFormat :: Plain { prefix } => info ! (
9293 target: "substrate" ,
93- "{}{} ({} peers), best: #{} ({}), finalized #{} ({}), ⬇ {} ⬆ {}" ,
94+ "{} {}{}{} ({} peers), best: #{} ({}), finalized #{} ({}), ⬇ {} ⬆ {}" ,
95+ level,
96+ prefix,
9497 status,
9598 target,
9699 num_connected_peers,
@@ -100,7 +103,7 @@ impl<B: BlockT> InformantDisplay<B> {
100103 info. chain. finalized_hash,
101104 TransferRateFormat ( net_status. average_download_per_sec) ,
102105 TransferRateFormat ( net_status. average_upload_per_sec) ,
103- ) ;
106+ ) ,
104107 }
105108 }
106109}
0 commit comments