diff --git a/CHANGELOG.md b/CHANGELOG.md index cb3112522..266c40567 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ ## Unreleased +#### 🚀 Updates + +- Added a `--log verbose` level, which includes span information on top of the trace level. + #### 🐞 Fixes - Fixed an issue where `--dump` can be interrupted. diff --git a/crates/cli/src/app.rs b/crates/cli/src/app.rs index 52c249bd1..dcb59d16e 100644 --- a/crates/cli/src/app.rs +++ b/crates/cli/src/app.rs @@ -23,6 +23,13 @@ pub enum LogLevel { Info, Debug, Trace, + Verbose, +} + +impl LogLevel { + pub fn is_verbose(&self) -> bool { + matches!(self, Self::Verbose) + } } impl Display for LogLevel { @@ -36,7 +43,8 @@ impl Display for LogLevel { LogLevel::Warn => "warn", LogLevel::Info => "info", LogLevel::Debug => "debug", - LogLevel::Trace => "trace", + // Must map to tracing levels + LogLevel::Trace | LogLevel::Verbose => "trace", } )?; diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 1aedad7ed..c78d104bc 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -52,6 +52,7 @@ async fn main() -> MainResult { dump_trace: cli.dump && !matches!(cli.command, Commands::Run { .. }), filter_modules: get_tracing_modules(), log_env: "PROTO_APP_LOG".into(), + show_spans: cli.log.as_ref().is_some_and(|level| level.is_verbose()), // test_env: "PROTO_TEST".into(), ..TracingOptions::default() });