Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

replaced println with log Closes #12338 #12348

Merged
merged 7 commits into from
Oct 28, 2022
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions utils/frame/benchmarking-cli/src/pallet/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
use sp_state_machine::StateMachine;
use std::{collections::HashMap, fmt::Debug, fs, sync::Arc, time};

/// Logging target
const LOG_TARGET:&'static str = "frame::benchmark::pallet";

/// The inclusive range of a component.
#[derive(Serialize, Debug, Clone, Eq, PartialEq)]
pub(crate) struct ComponentRange {
Expand Down Expand Up @@ -242,7 +245,9 @@ impl PalletCmd {
let mut component_ranges = HashMap::<(Vec<u8>, Vec<u8>), Vec<ComponentRange>>::new();

for (pallet, extrinsic, components) in benchmarks_to_run {
println!(

log::info!(
target: LOG_TARGET,
"Starting benchmark: {}::{}",
String::from_utf8(pallet.clone()).expect("Encoded from String; qed"),
String::from_utf8(extrinsic.clone()).expect("Encoded from String; qed"),
Expand Down Expand Up @@ -402,7 +407,9 @@ impl PalletCmd {
if let Ok(elapsed) = timer.elapsed() {
if elapsed >= time::Duration::from_secs(5) {
timer = time::SystemTime::now();
println!(

log::info!(
target: LOG_TARGET,
"Running Benchmark: {}.{}({} args) {}/{} {}/{}",
String::from_utf8(pallet.clone())
.expect("Encoded from String; qed"),
Expand Down Expand Up @@ -492,7 +499,7 @@ impl PalletCmd {
if let Some(path) = &self.json_file {
fs::write(path, json)?;
} else {
println!("{}", json);
print!("{json}");
return Ok(true)
}
}
Expand Down