Skip to content

Commit

Permalink
chore: emojis ftw
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Feb 6, 2025
1 parent 66ad967 commit 4105edf
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions src/cli/ui/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,32 @@ fn on_action_executed(

let mut view = String::new();

view.push_str("🧠 ");
view.push_str(&invocation.action.bold().to_string());
view.push('(');
if let Some(payload) = &invocation.payload {
view.push_str(&payload.dimmed().to_string());
}
if let Some(attributes) = &invocation.attributes {
view.push_str(", ");
view.push_str(
&attributes
.iter()
.map(|(k, v)| format!("{}={}", k, v).dimmed().to_string())
.collect::<Vec<String>>()
.join(", "),
);
}
view.push(')');
view.push_str("🛠️ ");
view.push_str(&invocation.action.dimmed().to_string());
view.push_str(
&format!(
"({})",
if invocation.payload.is_some() {
"..."
} else {
""
}
)
.dimmed()
.to_string(),
);

if let Some(err) = error {
log::error!("{}: {}", view, err);
} else if let Some(res) = result {
log::debug!(
log::info!(
"{} -> {} bytes in {:?}",
view,
res.to_string().as_bytes().len(),
elapsed
);
} else {
log::debug!("{} {} in {:?}", view, "no output".dimmed(), elapsed);
log::info!("{} {} in {:?}", view, "no output".dimmed(), elapsed);
}
}

Expand Down

0 comments on commit 4105edf

Please sign in to comment.