mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 17:41:01 +00:00
sc-informant: Respect --disable-log-color (#3009)
Changes `sc-informant` to respect the `--disable-log-color` CLI flag. Closes: https://github.com/paritytech/polkadot-sdk/issues/2795 --------- Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
This commit is contained in:
@@ -142,37 +142,20 @@ impl<B: BlockT> InformantDisplay<B> {
|
||||
("⚙️ ", format!("Preparing{}", speed), format!(", target=#{target}")),
|
||||
};
|
||||
|
||||
if self.format.enable_color {
|
||||
info!(
|
||||
target: "substrate",
|
||||
"{} {}{} ({} peers), best: #{} ({}), finalized #{} ({}), {} {}",
|
||||
level,
|
||||
Colour::White.bold().paint(&status),
|
||||
target,
|
||||
Colour::White.bold().paint(format!("{}", num_connected_peers)),
|
||||
Colour::White.bold().paint(format!("{}", best_number)),
|
||||
best_hash,
|
||||
Colour::White.bold().paint(format!("{}", finalized_number)),
|
||||
info.chain.finalized_hash,
|
||||
Colour::Green.paint(format!("⬇ {}", TransferRateFormat(avg_bytes_per_sec_inbound))),
|
||||
Colour::Red.paint(format!("⬆ {}", TransferRateFormat(avg_bytes_per_sec_outbound))),
|
||||
)
|
||||
} else {
|
||||
info!(
|
||||
target: "substrate",
|
||||
"{} {}{} ({} peers), best: #{} ({}), finalized #{} ({}), ⬇ {} ⬆ {}",
|
||||
level,
|
||||
status,
|
||||
target,
|
||||
num_connected_peers,
|
||||
best_number,
|
||||
best_hash,
|
||||
finalized_number,
|
||||
info.chain.finalized_hash,
|
||||
TransferRateFormat(avg_bytes_per_sec_inbound),
|
||||
TransferRateFormat(avg_bytes_per_sec_outbound),
|
||||
)
|
||||
}
|
||||
info!(
|
||||
target: "substrate",
|
||||
"{} {}{} ({} peers), best: #{} ({}), finalized #{} ({}), {} {}",
|
||||
level,
|
||||
self.format.print_with_color(Colour::White.bold(), status),
|
||||
target,
|
||||
self.format.print_with_color(Colour::White.bold(), num_connected_peers),
|
||||
self.format.print_with_color(Colour::White.bold(), best_number),
|
||||
best_hash,
|
||||
self.format.print_with_color(Colour::White.bold(), finalized_number),
|
||||
info.chain.finalized_hash,
|
||||
self.format.print_with_color(Colour::Green, format!("⬇ {}", TransferRateFormat(avg_bytes_per_sec_inbound))),
|
||||
self.format.print_with_color(Colour::Red, format!("⬆ {}", TransferRateFormat(avg_bytes_per_sec_outbound))),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user