Skip to content

Commit

Permalink
refactor: improve std messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Sopena Ballesteros committed Jun 27, 2024
1 parent db0e74f commit 8de0c4a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/capmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ pub mod utils {
.collect();

print!(
"\rWaiting nodes to power on. Transitioning: {:?} ==> ON: {:?}. Trying again in {} seconds. Attempt {} of {}",
"\rWaiting nodes to power on. Transitioning: {:?} ==> ON: {:?}. Trying again in {} seconds. Attempt {} of {}.",
xname_vec.iter().filter(|xname| !node_on_vec.contains(xname)).collect::<Vec<_>>(),
node_on_vec,
delay_secs,
Expand Down Expand Up @@ -499,7 +499,7 @@ pub mod utils {
.collect();

print!(
"\rWaiting nodes to power off. Transitioning: {:?} ==> OFF: {:?}. Trying again in {} seconds. Attempt {} of {}",
"\rWaiting nodes to power off. Transitioning: {:?} ==> OFF: {:?}. Trying again in {} seconds. Attempt {} of {}.",
xname_vec.iter().filter(|xname| !node_off_vec.contains(xname)).collect::<Vec<_>>(),
node_off_vec,
delay_secs,
Expand Down
2 changes: 1 addition & 1 deletion src/cfs/component/mesa/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub async fn get_multiple(
let width = num_chunks.checked_ilog10().unwrap_or(0) as usize + 1;

for sub_node_list in hsm_groups_node_list.chunks(chunk_size) {
print!("\rGetting CFS components [{i:>width$}/{num_chunks}]");
print!("\rGetting CFS components (batch size - {num_chunks}) [{i:>width$}/{num_chunks}].");
io::stdout().flush().unwrap();

let shasta_token_string = shasta_token.to_string();
Expand Down
2 changes: 1 addition & 1 deletion src/cfs/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ pub mod mesa {
print!("\x1B[2K"); // Clear current line
io::stdout().flush().unwrap();
print!(
"\rWaiting CFS session '{}' with status '{}'. Checking again in 2 secs. Attempt {} of {}",
"\rWaiting CFS session '{}' with status '{}'. Checking again in 2 secs. Attempt {} of {}.",
cfs_session_id, cfs_session_status, i, max
);
io::stdout().flush().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/common/local_git_repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,13 @@ pub fn fetch<'a>(
cb.transfer_progress(|stats| {
if stats.received_objects() == stats.total_objects() {
print!(
"Resolving deltas {}/{}\r",
"Resolving deltas {}/{}.\r",
stats.indexed_deltas(),
stats.total_deltas()
);
} else if stats.total_objects() > 0 {
print!(
"Received {}/{} objects ({}) in {} bytes\r",
"Received {}/{} objects ({}) in {} bytes.\r",
stats.received_objects(),
stats.total_objects(),
stats.indexed_objects(),
Expand Down
2 changes: 1 addition & 1 deletion src/ims/job/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub async fn wait_ims_job_to_finish(
print!("\x1B[2K"); // Clear current line
io::stdout().flush().unwrap();
print!(
"\rWaiting IMS job '{}' with job status '{}'. Checking again in 2 secs. Attempt {} of {}",
"\rWaiting IMS job '{}' with job status '{}'. Checking again in 2 secs. Attempt {} of {}.",
ims_job_id, ims_job_status, i, max
);
io::stdout().flush().unwrap();
Expand Down

0 comments on commit 8de0c4a

Please sign in to comment.