feat: structured startup header with privileges, device, session

This commit is contained in:
Helios Agent 2026-03-05 20:22:58 +01:00
parent b37eec24bc
commit 03d80067a8
No known key found for this signature in database
GPG key ID: C8259547CD8309B5
2 changed files with 22 additions and 20 deletions

View file

@ -100,19 +100,13 @@ pub fn cmd_done(action: &str, name: &str, payload: &str, success: bool, result:
crate::logger::write_line(if success { "OK" } else { "ERROR" }, &format!("{name} {payload}{result}"));
}
/// Plain status line (banner / connection info), not in table format.
/// Uses 2 leading spaces + emoji + 2 spaces + message (no tab).
pub fn status(emoji: &str, msg: &str) {
println!(" {} {}", emoji, msg);
}
/// Same as status() but also logs to file.
pub fn ok(emoji: &str, msg: &str) {
println!(" {} {}", emoji, msg);
crate::logger::write_line("OK", msg);
/// Info line for the startup header (not in table format).
/// Aligns key to a fixed width so values line up.
pub fn info_line(emoji: &str, key: &str, value: &str) {
println!(" {} {:<12} {}", emoji_cell(emoji), key, value);
}
pub fn err(emoji: &str, msg: &str) {
println!(" {} {}", emoji, msg.red());
println!(" {} {}", emoji_cell(emoji), msg.red());
crate::logger::write_line("ERROR", msg);
}