diff --git a/packages/cli/src/build/context.rs b/packages/cli/src/build/context.rs index 3810c9ca38..ce51cbd80f 100644 --- a/packages/cli/src/build/context.rs +++ b/packages/cli/src/build/context.rs @@ -126,10 +126,16 @@ impl BuildContext { } pub(crate) fn status_build_message(&self, line: String) { - tracing::trace!(dx_src = ?TraceSrc::Cargo, "{line}"); + if !crate::logging::verbosity_or_default().quiet { + tracing::trace!(dx_src = ?TraceSrc::Cargo, "{line}"); + } } pub(crate) fn status_build_progress(&self, count: usize, total: usize, name: String) { + if crate::logging::verbosity_or_default().quiet { + return; + } + _ = self.tx.unbounded_send(BuilderUpdate::Progress { stage: BuildStage::Compiling { current: count, diff --git a/packages/cli/src/cli/verbosity.rs b/packages/cli/src/cli/verbosity.rs index 268e70f79c..7c4914a42f 100644 --- a/packages/cli/src/cli/verbosity.rs +++ b/packages/cli/src/cli/verbosity.rs @@ -11,6 +11,15 @@ pub struct Verbosity { #[clap(long, global = true)] pub(crate) trace: bool, + /// Use quiet output - only show warnings, errors, and final status [default: false] + #[clap( + long, + global = true, + conflicts_with = "verbose", + conflicts_with = "trace" + )] + pub(crate) quiet: bool, + /// Output logs in JSON format #[clap(long, global = true)] pub(crate) json_output: bool, diff --git a/packages/cli/src/test_harnesses.rs b/packages/cli/src/test_harnesses.rs index 7f08494f0a..c5d914745e 100644 --- a/packages/cli/src/test_harnesses.rs +++ b/packages/cli/src/test_harnesses.rs @@ -365,6 +365,7 @@ fn main() { _ = crate::VERBOSITY.set(crate::Verbosity { verbose: true, trace: true, + quiet: false, json_output: false, log_to_file: None, locked: false,