mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +00:00
* replaced println with log Closes #12338 * fixed println * Apply suggestions from code review Co-authored-by: Bastian Köcher <git@kchr.de> * Update utils/frame/benchmarking-cli/src/pallet/command.rs * Apply suggestions from code review * ".git/.scripts/fmt.sh" 1 Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: command-bot <>
This commit is contained in:
@@ -40,6 +40,9 @@ use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
|
|||||||
use sp_state_machine::StateMachine;
|
use sp_state_machine::StateMachine;
|
||||||
use std::{collections::HashMap, fmt::Debug, fs, sync::Arc, time};
|
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.
|
/// The inclusive range of a component.
|
||||||
#[derive(Serialize, Debug, Clone, Eq, PartialEq)]
|
#[derive(Serialize, Debug, Clone, Eq, PartialEq)]
|
||||||
pub(crate) struct ComponentRange {
|
pub(crate) struct ComponentRange {
|
||||||
@@ -242,7 +245,8 @@ impl PalletCmd {
|
|||||||
let mut component_ranges = HashMap::<(Vec<u8>, Vec<u8>), Vec<ComponentRange>>::new();
|
let mut component_ranges = HashMap::<(Vec<u8>, Vec<u8>), Vec<ComponentRange>>::new();
|
||||||
|
|
||||||
for (pallet, extrinsic, components) in benchmarks_to_run {
|
for (pallet, extrinsic, components) in benchmarks_to_run {
|
||||||
println!(
|
log::info!(
|
||||||
|
target: LOG_TARGET,
|
||||||
"Starting benchmark: {}::{}",
|
"Starting benchmark: {}::{}",
|
||||||
String::from_utf8(pallet.clone()).expect("Encoded from String; qed"),
|
String::from_utf8(pallet.clone()).expect("Encoded from String; qed"),
|
||||||
String::from_utf8(extrinsic.clone()).expect("Encoded from String; qed"),
|
String::from_utf8(extrinsic.clone()).expect("Encoded from String; qed"),
|
||||||
@@ -402,7 +406,9 @@ impl PalletCmd {
|
|||||||
if let Ok(elapsed) = timer.elapsed() {
|
if let Ok(elapsed) = timer.elapsed() {
|
||||||
if elapsed >= time::Duration::from_secs(5) {
|
if elapsed >= time::Duration::from_secs(5) {
|
||||||
timer = time::SystemTime::now();
|
timer = time::SystemTime::now();
|
||||||
println!(
|
|
||||||
|
log::info!(
|
||||||
|
target: LOG_TARGET,
|
||||||
"Running Benchmark: {}.{}({} args) {}/{} {}/{}",
|
"Running Benchmark: {}.{}({} args) {}/{} {}/{}",
|
||||||
String::from_utf8(pallet.clone())
|
String::from_utf8(pallet.clone())
|
||||||
.expect("Encoded from String; qed"),
|
.expect("Encoded from String; qed"),
|
||||||
@@ -492,7 +498,7 @@ impl PalletCmd {
|
|||||||
if let Some(path) = &self.json_file {
|
if let Some(path) = &self.json_file {
|
||||||
fs::write(path, json)?;
|
fs::write(path, json)?;
|
||||||
} else {
|
} else {
|
||||||
println!("{}", json);
|
print!("{json}");
|
||||||
return Ok(true)
|
return Ok(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user