From 24f94d5911c825495996bcac9d2d0b461d6f7f0f Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 10 Oct 2024 15:26:38 -0700 Subject: [PATCH 1/2] Add verbose. --- crates/cli/src/app.rs | 10 +++++++++- crates/cli/src/main.rs | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) 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() }); From a2ee5b4fed8ffacdb1dff6b83e99fd5569c80745 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 10 Oct 2024 15:27:20 -0700 Subject: [PATCH 2/2] Update changelog. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) 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.