diff --git a/crates/kit/src/main.rs b/crates/kit/src/main.rs index c97f005..815f092 100644 --- a/crates/kit/src/main.rs +++ b/crates/kit/src/main.rs @@ -154,7 +154,11 @@ fn install_tracing() { use tracing_subscriber::prelude::*; use tracing_subscriber::EnvFilter; - let fmt_layer = fmt::layer().with_target(false).with_writer(std::io::stderr); + let format = fmt::format().without_time().with_target(false).compact(); + + let fmt_layer = fmt::layer() + .event_format(format) + .with_writer(std::io::stderr); let filter_layer = EnvFilter::try_from_default_env() .or_else(|_| EnvFilter::try_new("info")) .unwrap(); diff --git a/crates/kit/src/run_ephemeral.rs b/crates/kit/src/run_ephemeral.rs index fb103f6..07b6694 100644 --- a/crates/kit/src/run_ephemeral.rs +++ b/crates/kit/src/run_ephemeral.rs @@ -154,6 +154,13 @@ pub struct CommonPodmanOptions { help = "Add metadata to the container in key=value form" )] pub label: Vec, + + #[clap( + long = "env", + short = 'e', + help = "Set environment variables in the container (key=value)" + )] + pub env: Vec, } /// Common VM configuration options for hardware, networking, and features. @@ -400,6 +407,9 @@ fn prepare_run_command_with_temp( if opts.podman.detach { cmd.arg("-d"); } + for env in opts.podman.env.iter() { + cmd.arg(format!("--env={env}")); + } let vhost_dev = Utf8Path::new(qemu::VHOST_VSOCK) .try_exists()? @@ -463,11 +473,6 @@ fn prepare_run_command_with_temp( cmd.args(["-v", &format!("{}:/run/systemd-units:ro", units_dir)]); } - // Propagate this by default - if let Some(log) = std::env::var("RUST_LOG").ok() { - cmd.arg(format!("--env=RUST_LOG={log}")); - } - // Pass configuration as JSON via BCK_CONFIG environment variable let config = serde_json::to_string(&opts).unwrap(); cmd.args(["-e", &format!("BCK_CONFIG={config}")]);