diff --git a/src/daemon.rs b/src/daemon.rs index 656fd11..58fc24b 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -410,7 +410,7 @@ impl Daemon { }; debug!("got cmd: {cmd:?}"); let _ = rustix::io::write(fd, b""); - info!("dispatching command"); + info!("dispatching command {cmd:?}"); self.dispatch_cmd(cmd).unwrap_or_else(|e| todo!("{e}")); } @@ -461,6 +461,14 @@ impl Daemon { .arg("--impure") .arg("-E") .arg(expr) + .tap(|cmd| { + if !tracing::enabled!(Level::INFO) { + return; + } + let args: Vec> = cmd.get_args().map(OsStr::to_string_lossy).collect(); + let separated = args.join(" "); + info!("Spawning subprocess: [{separated}]"); + }) .stdout(Stdio::piped()) .stderr(Stdio::piped()) .spawn() @@ -638,7 +646,7 @@ impl Daemon { let either_available = event.is_readable() || event.is_writable(); if !either_available { info!( - "File descriptor {} r:{}, w:{}", + "Got EVENT for file descriptor '{}': r={}, w={}", info.display(), event.is_readable(), event.is_writable(), @@ -663,7 +671,7 @@ impl Daemon { todo!("waitid() returned None? for pid {pid}"); }); - debug!("waitid() for pid {pid} returned status: {status:?}"); + trace!("waitid() for pid {pid} returned status: {status:?}"); let is_dead = status.exited() || status.killed() || status.dumped(); if !is_dead { todo!("Handle process {pid} events that aren't death: {status:?}"); @@ -690,14 +698,12 @@ impl Daemon { } }, FdKind::ChildStdout(_pid) => { - warn!("got stdout"); // SAFETY: oh boy. let stdout = unsafe { BorrowedFd::borrow_raw(fd) }; self.proxy_stdio(&stdout) .unwrap_or_else(|e| error!("failed to proxy child stdout: {e}")); }, FdKind::ChildStderr(_pid) => { - warn!("got stderr"); // SAFETY: oh boy. let stderr = unsafe { BorrowedFd::borrow_raw(fd) }; self.proxy_stdio(&stderr) diff --git a/src/main.rs b/src/main.rs index e2c5214..b5e85d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ fn main_wrapped() -> Result<(), Box> { // Default RUST_LOG to warn if it's not specified. if env::var_os("RUST_LOG").is_none() { unsafe { - env::set_var("RUST_LOG", "warn"); + env::set_var("RUST_LOG", "info"); } } diff --git a/tests/dynix-vm-configuration.nix b/tests/dynix-vm-configuration.nix index f7370ae..41c6b12 100644 --- a/tests/dynix-vm-configuration.nix +++ b/tests/dynix-vm-configuration.nix @@ -69,7 +69,7 @@ in path = [ config.nix.package ]; serviceConfig = { Environment = [ - "RUST_LOG=info,dynix=trace" + "RUST_LOG=info,dynix=debug" ]; ExecSearchPath = [ "/run/current-system/sw/bin" ]; SuccessExitStatus = [ "0" "2" ];