on main help sign in
Merge pull request #3 from robcholz/consistency

Consistency

commitfc9edbb0fe430d25adc6d1f2c2e9a6ea07490f48 authorFinn Sheng <yupbrokendream@gmail.com> dateSat 7 Feb 2026, 20:04 (8 months ago) parent166b035f02cb4c
8 files changed+188−71
docs/tasks.md+3−2 src/bin/vibebox-cli.rs+68−13 src/bin/vibebox-supervisor.rs+21−7 src/config.rs+1−1 src/instance.rs+62−30 src/tui.rs+21−6 src/vm.rs+10−10 src/vm_manager.rs+2−2
docs/tasks.md+3−2
@@ -47,8 +47,9 @@
4747 2. [x] Remove old cli.
4848 3. [x] add an actual config file.
4949 4. [x] set up the cli.
50−9. [ ] fix ui overlap, and consistency issue.
51−10. [ ] intensive integration test.
50+9. [x] fix ui overlap, and consistency issue.
51+10. [ ] `clean_cache` to cleanup the cache.
52+11. [ ] intensive integration test.
5253
5354## Publish
5455
src/bin/vibebox-cli.rs+68−13
@@ -11,7 +11,9 @@ use color_eyre::Result;
1111use dialoguer::Confirm;
1212use time::OffsetDateTime;
1313use time::format_description::well_known::Rfc3339;
14−use tracing_subscriber::EnvFilter;
14+use tracing_subscriber::filter::LevelFilter;
15+use tracing_subscriber::registry::Registry;
16+use tracing_subscriber::{EnvFilter, fmt, prelude::*, reload};
1517
1618use vibebox::tui::{AppState, VmInfo};
1719use vibebox::{
@@ -39,11 +41,11 @@ enum Command {
3941}
4042
4143fn main() -> Result<()> {
42− init_tracing();
4344 color_eyre::install()?;
45+ let cwd = env::current_dir().map_err(|err| color_eyre::eyre::eyre!(err.to_string()))?;
46+ let stderr_handle = init_tracing(&cwd);
4447
4548 let cli = Cli::parse();
46− let cwd = env::current_dir().map_err(|err| color_eyre::eyre::eyre!(err.to_string()))?;
4749 tracing::info!(cwd = %cwd.display(), "starting vibebox cli");
4850 if let Some(command) = cli.command {
4951 return handle_command(command, &cwd, cli.config.as_deref());
@@ -79,12 +81,13 @@ fn main() -> Result<()> {
7981 mounts: config.box_cfg.mounts.clone(),
8082 };
8183
84+ let auto_shutdown_ms = config.supervisor.auto_shutdown_ms;
8285 let vm_info = VmInfo {
83− version: env!("CARGO_PKG_VERSION").to_string(),
8486 max_memory_mb: vm_args.ram_bytes / (1024 * 1024),
8587 cpu_cores: vm_args.cpu_count,
88+ system_name: "Debian".to_string(), // TODO: read system name from the VM.
89+ auto_shutdown_ms,
8690 };
87− let auto_shutdown_ms = config.supervisor.auto_shutdown_ms;
8891 if let Ok(manager) = SessionManager::new() {
8992 if let Err(err) = manager.update_global_sessions(&cwd) {
9093 tracing::warn!(error = %err, "failed to update a global session list");
@@ -104,6 +107,9 @@ fn main() -> Result<()> {
104107 writeln!(stdout)?;
105108 stdout.flush()?;
106109 }
110+ if let Some(handle) = stderr_handle {
111+ let _ = handle.modify(|filter| *filter = LevelFilter::INFO);
112+ }
107113
108114 tracing::info!(auto_shutdown_ms, "auto shutdown config");
109115 let manager_conn =
@@ -248,13 +254,62 @@ fn format_last_active(value: Option<&str>) -> String {
248254 format!("{} day{} ago", days, if days == 1 { "" } else { "s" })
249255}
250256
251−fn init_tracing() {
257+type StderrHandle = reload::Handle<LevelFilter, Registry>;
258+
259+fn init_tracing(cwd: &Path) -> Option<StderrHandle> {
252260 let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
253− let ansi = std::io::stderr().is_terminal() && env::var("VIBEBOX_LOG_NO_COLOR").is_err();
254− let _ = tracing_subscriber::fmt()
255− .with_env_filter(filter)
256− .with_target(false)
257− .with_ansi(ansi)
258− .with_writer(std::io::stderr)
259− .try_init();
261+ let file_filter = filter.clone();
262+ let stderr_is_tty = std::io::stderr().is_terminal();
263+ let ansi = stderr_is_tty && env::var("VIBEBOX_LOG_NO_COLOR").is_err();
264+ let file = instance::ensure_instance_dir(cwd)
265+ .ok()
266+ .and_then(|instance_dir| {
267+ let log_path = instance_dir.join("cli.log");
268+ std::fs::OpenOptions::new()
269+ .create(true)
270+ .write(true)
271+ .truncate(true)
272+ .open(log_path)
273+ .ok()
274+ });
275+
276+ if stderr_is_tty {
277+ let (stderr_filter, handle) = reload::Layer::new(LevelFilter::OFF);
278+ let stderr_layer = fmt::layer()
279+ .with_target(false)
280+ .with_ansi(ansi)
281+ .without_time()
282+ .with_writer(std::io::stderr)
283+ .with_filter(stderr_filter);
284+ let subscriber = tracing_subscriber::registry().with(stderr_layer);
285+ if let Some(file) = file {
286+ let file_layer = fmt::layer()
287+ .with_target(false)
288+ .with_ansi(false)
289+ .with_writer(file)
290+ .with_filter(file_filter);
291+ let _ = subscriber.with(file_layer).try_init();
292+ } else {
293+ let _ = subscriber.try_init();
294+ }
295+ Some(handle)
296+ } else {
297+ let stderr_layer = fmt::layer()
298+ .with_target(false)
299+ .with_ansi(ansi)
300+ .with_writer(std::io::stderr)
301+ .with_filter(filter);
302+ let subscriber = tracing_subscriber::registry().with(stderr_layer);
303+ if let Some(file) = file {
304+ let file_layer = fmt::layer()
305+ .with_target(false)
306+ .with_ansi(false)
307+ .with_writer(file)
308+ .with_filter(file_filter);
309+ let _ = subscriber.with(file_layer).try_init();
310+ } else {
311+ let _ = subscriber.try_init();
312+ }
313+ None
314+ }
260315}
src/bin/vibebox-supervisor.rs+21−7
@@ -5,6 +5,9 @@ use std::{
55
66use color_eyre::Result;
77use tracing_subscriber::EnvFilter;
8+use tracing_subscriber::filter::LevelFilter;
9+use tracing_subscriber::fmt;
10+use tracing_subscriber::prelude::*;
811
912use vibebox::{config, instance, vm, vm_manager};
1013
@@ -40,11 +43,22 @@ fn main() -> Result<()> {
4043
4144fn init_tracing() {
4245 let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
43− let ansi = std::io::stderr().is_terminal() && env::var("VIBEBOX_LOG_NO_COLOR").is_err();
44− let _ = tracing_subscriber::fmt()
45− .with_env_filter(filter)
46− .with_target(false)
47− .with_ansi(ansi)
48− .with_writer(io::stderr)
49− .try_init();
46+ let stderr_is_tty = std::io::stderr().is_terminal();
47+ let ansi = stderr_is_tty && env::var("VIBEBOX_LOG_NO_COLOR").is_err();
48+ if stderr_is_tty {
49+ let stderr_layer = fmt::layer()
50+ .with_target(false)
51+ .with_ansi(ansi)
52+ .without_time()
53+ .with_writer(io::stderr)
54+ .with_filter(LevelFilter::INFO);
55+ let _ = tracing_subscriber::registry().with(stderr_layer).try_init();
56+ } else {
57+ let stderr_layer = fmt::layer()
58+ .with_target(false)
59+ .with_ansi(ansi)
60+ .with_writer(io::stderr)
61+ .with_filter(filter);
62+ let _ = tracing_subscriber::registry().with(stderr_layer).try_init();
63+ }
5064}
src/config.rs+1−1
@@ -279,6 +279,6 @@ fn validate_or_exit(config: &Config) {
279279}
280280
281281fn die(message: &str) -> ! {
282− eprintln!("[vibebox] {message}");
282+ tracing::error!("{message}");
283283 std::process::exit(1);
284284}
src/instance.rs+62−30
@@ -26,7 +26,7 @@ use crate::{
2626};
2727
2828const SSH_KEY_NAME: &str = "ssh_key";
29−pub(crate) const SERIAL_LOG_NAME: &str = "serial.log";
29+pub(crate) const VM_ROOT_LOG_NAME: &str = "vm_root.log";
3030pub(crate) const DEFAULT_SSH_USER: &str = "vibecoder";
3131const SSH_CONNECT_RETRIES: usize = 30;
3232const SSH_CONNECT_DELAY_MS: u64 = 500;
@@ -72,7 +72,6 @@ pub fn run_with_ssh(manager_conn: UnixStream) -> Result<(), Box<dyn std::error::
7272 tracing::debug!(ssh_user = %ssh_user, "loaded instance config");
7373
7474 let _manager_conn = manager_conn;
75− tracing::debug!("waiting for vm ipv4");
7675 wait_for_vm_ipv4(&instance_dir, Duration::from_secs(120))?;
7776
7877 let ip = load_or_create_instance_config(&instance_dir)?
@@ -118,7 +117,7 @@ pub(crate) fn ensure_ssh_keypair(
118117 "vibebox",
119118 ])
120119 .stdin(Stdio::null())
121− .stdout(Stdio::null())
120+ .stdout(Stdio::inherit())
122121 .stderr(Stdio::inherit())
123122 .status()?;
124123
@@ -246,6 +245,9 @@ fn wait_for_vm_ipv4(
246245 timeout: Duration,
247246) -> Result<(), Box<dyn std::error::Error>> {
248247 let start = Instant::now();
248+ let mut next_log_at = start + Duration::from_secs(10);
249+ tracing::info!("waiting for vm ipv4");
250+ let mut once_hint = false;
249251 loop {
250252 let config = load_or_create_instance_config(instance_dir)?;
251253 if config.vm_ipv4.is_some() {
@@ -254,8 +256,16 @@ fn wait_for_vm_ipv4(
254256 if start.elapsed() > timeout {
255257 return Err("Timed out waiting for VM IPv4".into());
256258 }
257− if start.elapsed().as_secs() % 5 == 0 {
258− tracing::debug!("still waiting for vm ipv4");
259+ if Instant::now() >= next_log_at {
260+ let waited = start.elapsed();
261+ if waited.as_secs() > 15 && !once_hint {
262+ tracing::info!(
263+ "if vibebox is just initialized in this directory, it might take up to 1 minutes depending on your machine, and then you can enjoy the speed vibecoding! go pack!"
264+ );
265+ once_hint = true;
266+ }
267+ tracing::info!("still waiting for vm ipv4, {}s elapsed", waited.as_secs(),);
268+ next_log_at += Duration::from_secs(10);
259269 }
260270 thread::sleep(Duration::from_millis(200));
261271 }
@@ -270,9 +280,13 @@ fn run_ssh_session(
270280 loop {
271281 attempts += 1;
272282 if !ssh_port_open(&ip) {
273− tracing::debug!(attempts, "ssh port not open yet");
274− eprintln!(
275− "[vibebox] waiting for ssh port on {ip} (attempt {attempts}/{SSH_CONNECT_RETRIES})"
283+ tracing::debug!(attempts, "ssh port doesn't open yet");
284+ tracing::info!(
285+ attempts,
286+ ip = %ip,
287+ "waiting for ssh port ({}/{})",
288+ attempts,
289+ SSH_CONNECT_RETRIES
276290 );
277291 if attempts >= SSH_CONNECT_RETRIES {
278292 return Err(
@@ -283,10 +297,14 @@ fn run_ssh_session(
283297 continue;
284298 }
285299
286− eprintln!(
287− "[vibebox] starting ssh to {ssh_user}@{ip} (attempt {attempts}/{SSH_CONNECT_RETRIES})"
300+ tracing::info!(
301+ attempts,
302+ user = %ssh_user,
303+ ip = %ip,
304+ "starting ssh ({}/{})",
305+ attempts,
306+ SSH_CONNECT_RETRIES
288307 );
289− tracing::info!(attempts, user = %ssh_user, ip = %ip, "starting ssh");
290308 let status = Command::new("ssh")
291309 .args([
292310 "-i",
@@ -319,21 +337,22 @@ fn run_ssh_session(
319337
320338 match status {
321339 Ok(status) if status.success() => {
322− eprintln!("[vibebox] ssh exited with status: {status}");
340+ tracing::info!(status = %status, "ssh exited");
323341 break;
324342 }
325343 Ok(status) if status.code() == Some(255) => {
326− eprintln!("[vibebox] ssh connection failed: {status}");
344+ tracing::warn!(status = %status, "ssh connection failed");
327345 if attempts >= SSH_CONNECT_RETRIES {
328346 return Err(format!("ssh failed after {SSH_CONNECT_RETRIES} attempts").into());
329347 }
330348 thread::sleep(Duration::from_millis(500));
331349 }
332350 Ok(status) => {
333− eprintln!("[vibebox] ssh exited with status: {status}");
351+ tracing::info!(status = %status, "ssh exited");
334352 break;
335353 }
336354 Err(err) => {
355+ tracing::error!(error = %err, "failed to start ssh");
337356 return Err(format!("failed to start ssh: {err}").into());
338357 }
339358 }
@@ -404,7 +423,7 @@ fn spawn_ssh_io(
404423) -> vm::IoContext {
405424 let io_control = vm::IoControl::new();
406425
407− let log_path = instance_dir.join(SERIAL_LOG_NAME);
426+ let log_path = instance_dir.join(VM_ROOT_LOG_NAME);
408427 let log_file = fs::OpenOptions::new()
409428 .create(true)
410429 .write(true)
@@ -458,7 +477,7 @@ fn spawn_ssh_io(
458477 if cfg.vm_ipv4.as_deref() != Some(ip.as_str()) {
459478 cfg.vm_ipv4 = Some(ip.clone());
460479 let _ = write_instance_config(&instance_path, &cfg);
461− eprintln!("[vibebox] detected vm IPv4: {ip}");
480+ tracing::info!(ip = %ip, "detected vm ipv4");
462481 }
463482 }
464483 }
@@ -466,7 +485,7 @@ fn spawn_ssh_io(
466485
467486 if cleaned.contains("VIBEBOX_SSH_READY") {
468487 ssh_ready_for_output.store(true, Ordering::SeqCst);
469− eprintln!("[vibebox] sshd ready");
488+ tracing::info!("sshd ready");
470489 }
471490 }
472491 };
@@ -517,7 +536,7 @@ fn spawn_ssh_io(
517536 break;
518537 }
519538
520− eprintln!("[vibebox] starting ssh to {ssh_user}@{ip}");
539+ tracing::info!(user = %ssh_user, ip = %ip, "starting ssh");
521540 io_control_for_thread.request_terminal_restore();
522541 io_control_for_thread.set_forward_output(false);
523542 io_control_for_thread.set_forward_input(false);
@@ -527,13 +546,19 @@ fn spawn_ssh_io(
527546 loop {
528547 attempts += 1;
529548 if !ssh_port_open(&ip) {
530− eprintln!(
531− "[vibebox] waiting for ssh port on {ip} (attempt {attempts}/{SSH_CONNECT_RETRIES})"
549+ tracing::info!(
550+ attempts,
551+ ip = %ip,
552+ "waiting for ssh port ({}/{})",
553+ attempts,
554+ SSH_CONNECT_RETRIES
532555 );
533556 if attempts >= SSH_CONNECT_RETRIES {
534557 ssh_connected_for_thread.store(false, Ordering::SeqCst);
535− eprintln!(
536− "[vibebox] ssh port not ready after {SSH_CONNECT_RETRIES} attempts"
558+ tracing::warn!(
559+ attempts,
560+ "ssh port not ready after {} attempts",
561+ SSH_CONNECT_RETRIES
537562 );
538563 break;
539564 }
@@ -541,8 +566,13 @@ fn spawn_ssh_io(
541566 continue;
542567 }
543568
544− eprintln!(
545− "[vibebox] starting ssh to {ssh_user}@{ip} (attempt {attempts}/{SSH_CONNECT_RETRIES})"
569+ tracing::info!(
570+ attempts,
571+ user = %ssh_user,
572+ ip = %ip,
573+ "starting ssh ({}/{})",
574+ attempts,
575+ SSH_CONNECT_RETRIES
546576 );
547577 let status = Command::new("ssh")
548578 .args([
@@ -577,18 +607,20 @@ fn spawn_ssh_io(
577607 match status {
578608 Ok(status) if status.success() => {
579609 ssh_connected_for_thread.store(false, Ordering::SeqCst);
580− eprintln!("[vibebox] ssh exited with status: {status}");
610+ tracing::info!(status = %status, "ssh exited");
581611 if let Some(tx) = input_tx_holder_for_thread.lock().unwrap().clone() {
582612 let _ = tx.send(VmInput::Bytes(b"systemctl poweroff\n".to_vec()));
583613 }
584614 break;
585615 }
586616 Ok(status) if status.code() == Some(255) => {
587− eprintln!("[vibebox] ssh connection failed: {status}");
617+ tracing::warn!(status = %status, "ssh connection failed");
588618 if attempts >= SSH_CONNECT_RETRIES {
589619 ssh_connected_for_thread.store(false, Ordering::SeqCst);
590− eprintln!(
591− "[vibebox] ssh failed after {SSH_CONNECT_RETRIES} attempts"
620+ tracing::warn!(
621+ attempts,
622+ "ssh failed after {} attempts",
623+ SSH_CONNECT_RETRIES
592624 );
593625 break;
594626 }
@@ -597,7 +629,7 @@ fn spawn_ssh_io(
597629 }
598630 Ok(status) => {
599631 ssh_connected_for_thread.store(false, Ordering::SeqCst);
600− eprintln!("[vibebox] ssh exited with status: {status}");
632+ tracing::info!(status = %status, "ssh exited");
601633 if let Some(tx) = input_tx_holder_for_thread.lock().unwrap().clone() {
602634 let _ = tx.send(VmInput::Bytes(b"systemctl poweroff\n".to_vec()));
603635 }
@@ -605,7 +637,7 @@ fn spawn_ssh_io(
605637 }
606638 Err(err) => {
607639 ssh_connected_for_thread.store(false, Ordering::SeqCst);
608− eprintln!("[vibebox] failed to start ssh: {err}");
640+ tracing::error!(error = %err, "failed to start ssh");
609641 break;
610642 }
611643 }
src/tui.rs+21−6
@@ -34,12 +34,14 @@ const ASCII_BANNER: [&str; 7] = [
3434 " ╚═══╝ ╚═╝╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝",
3535 "",
3636];
37+const INFO_LINE_COUNT: u16 = 5;
3738
3839#[derive(Debug, Clone)]
3940pub struct VmInfo {
40− pub version: String,
4141 pub max_memory_mb: u64,
4242 pub cpu_cores: usize,
43+ pub system_name: String,
44+ pub auto_shutdown_ms: u64,
4345}
4446
4547#[derive(Debug)]
@@ -155,10 +157,14 @@ fn compute_page_layout(app: &AppState, width: u16) -> PageLayout {
155157fn header_height() -> u16 {
156158 let banner_height = ASCII_BANNER.len() as u16;
157159 let welcome_height = 1;
158− let info_height = 4;
160+ let info_height = info_block_height();
159161 welcome_height + banner_height + info_height
160162}
161163
164+fn info_block_height() -> u16 {
165+ INFO_LINE_COUNT.saturating_add(1)
166+}
167+
162168pub fn render_tui_once(app: &mut AppState) -> Result<()> {
163169 let (width, _) = crossterm::terminal::size()?;
164170 if width == 0 {
@@ -532,13 +538,15 @@ fn render_header(buffer: &mut Buffer, area: Rect, app: &AppState) {
532538 .constraints([
533539 Constraint::Length(1),
534540 Constraint::Length(ASCII_BANNER.len() as u16),
535− Constraint::Length(4),
541+ Constraint::Length(info_block_height()),
536542 ])
537543 .split(area);
538544
545+ let version = env!("CARGO_PKG_VERSION");
546+
539547 let welcome = Line::from(vec![
540548 Span::raw("Welcome to Vibebox v"),
541− Span::styled(&app.vm_info.version, Style::default().fg(Color::Yellow)),
549+ Span::styled(version, Style::default().fg(Color::Yellow)),
542550 ]);
543551
544552 Paragraph::new(welcome).render(header_chunks[0], buffer);
@@ -557,8 +565,8 @@ fn render_header(buffer: &mut Buffer, area: Rect, app: &AppState) {
557565 Span::styled(app.cwd.to_string_lossy(), Style::default().fg(Color::Cyan)),
558566 ]),
559567 Line::from(vec![
560− Span::raw("VM Version: "),
561− Span::styled(&app.vm_info.version, Style::default().fg(Color::Green)),
568+ Span::raw("System: "),
569+ Span::styled(&app.vm_info.system_name, Style::default().fg(Color::Green)),
562570 ]),
563571 Line::from(vec![
564572 Span::raw("CPU / Memory: "),
@@ -570,6 +578,13 @@ fn render_header(buffer: &mut Buffer, area: Rect, app: &AppState) {
570578 Style::default().fg(Color::Green),
571579 ),
572580 ]),
581+ Line::from(vec![
582+ Span::raw("Auto Shutdown: "),
583+ Span::styled(
584+ format!("{} ms", app.vm_info.auto_shutdown_ms),
585+ Style::default().fg(Color::Green),
586+ ),
587+ ]),
573588 ];
574589
575590 Paragraph::new(info_lines)
src/vm.rs+10−10
@@ -429,7 +429,7 @@ fn ensure_base_image(
429429 if !base_compressed.exists()
430430 || std::fs::metadata(base_compressed).map(|m| m.len())? < DEBIAN_COMPRESSED_SIZE_BYTES
431431 {
432− println!("Downloading base image...");
432+ tracing::info!("downloading base image");
433433 let status = Command::new("curl")
434434 .args([
435435 "--continue-at",
@@ -470,7 +470,7 @@ fn ensure_base_image(
470470 }
471471 }
472472
473− println!("Decompressing base image...");
473+ tracing::info!("decompressing base image");
474474 let status = Command::new("tar")
475475 .args([
476476 "-xOf",
@@ -499,7 +499,7 @@ fn ensure_default_image(
499499
500500 ensure_base_image(base_raw, base_compressed)?;
501501
502− println!("Configuring base image...");
502+ tracing::info!("configuring base image");
503503 fs::copy(base_raw, default_raw)?;
504504
505505 let provision_command = script_command_from_content(PROVISION_SCRIPT_NAME, PROVISION_SCRIPT)?;
@@ -522,7 +522,7 @@ fn ensure_instance_disk(
522522 return Ok(());
523523 }
524524
525− println!("Creating instance disk from {}...", template_raw.display());
525+ tracing::info!(path = %template_raw.display(), "creating instance disk");
526526 std::fs::create_dir_all(instance_raw.parent().unwrap())?;
527527 fs::copy(template_raw, instance_raw)?;
528528 Ok(())
@@ -961,7 +961,7 @@ fn spawn_login_actions_thread(
961961 let command = match script_command_from_path(&path, index) {
962962 Ok(command) => command,
963963 Err(err) => {
964− eprintln!("{err}");
964+ tracing::error!(error = %err, "failed to build login script command");
965965 return;
966966 }
967967 };
@@ -1042,7 +1042,7 @@ where
10421042 return Err("Timed out waiting for VM to start".into());
10431043 }
10441044
1045− println!("VM booting...");
1045+ tracing::info!("vm booting");
10461046
10471047 let output_monitor = Arc::new(OutputMonitor::default());
10481048 let io_ctx = io_handler(output_monitor.clone(), we_read_from, we_write_to);
@@ -1111,7 +1111,7 @@ where
11111111 unsafe {
11121112 if vm.canRequestStop() {
11131113 if let Err(err) = vm.requestStopWithError() {
1114− eprintln!("Failed to request VM stop: {:?}", err);
1114+ tracing::error!(error = ?err, "failed to request VM stop");
11151115 }
11161116 } else if vm.canStop() {
11171117 let handler = RcBlock::new(|_error: *mut NSError| {});
@@ -1249,15 +1249,15 @@ pub fn ensure_signed() {
12491249 match status {
12501250 Ok(s) if s.success() => {
12511251 let err = Command::new(&exe).args(std::env::args_os().skip(1)).exec();
1252− eprintln!("failed to re-exec after signing: {err}");
1252+ tracing::error!(error = %err, "failed to re-exec after signing");
12531253 std::process::exit(1);
12541254 }
12551255 Ok(s) => {
1256− eprintln!("codesign failed with status: {s}");
1256+ tracing::error!(status = %s, "codesign failed");
12571257 std::process::exit(1);
12581258 }
12591259 Err(e) => {
1260− eprintln!("failed to run codesign: {e}");
1260+ tracing::error!(error = %e, "failed to run codesign");
12611261 std::process::exit(1);
12621262 }
12631263 }
src/vm_manager.rs+2−2
@@ -17,7 +17,7 @@ use std::{
1717
1818use crate::{
1919 config::CONFIG_PATH_ENV,
20− instance::SERIAL_LOG_NAME,
20+ instance::VM_ROOT_LOG_NAME,
2121 instance::{
2222 DEFAULT_SSH_USER, InstanceConfig, build_ssh_login_actions, ensure_instance_dir,
2323 ensure_ssh_keypair, extract_ipv4, load_or_create_instance_config, write_instance_config,
@@ -451,7 +451,7 @@ fn spawn_manager_io(
451451 vm_output_fd: std::os::unix::io::OwnedFd,
452452 vm_input_fd: std::os::unix::io::OwnedFd,
453453) -> vm::IoContext {
454− let log_path = instance_dir.join(SERIAL_LOG_NAME);
454+ let log_path = instance_dir.join(VM_ROOT_LOG_NAME);
455455 let log_file = fs::OpenOptions::new()
456456 .create(true)
457457 .write(true)