diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-09-09 12:03:19 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-09 12:03:19 -0600 |
commit | 947865c05478fce0675fce93fd2811f93b703287 (patch) | |
tree | 576af06de06bc1cdd48b16eee745605792065a44 /cli/args/flags.rs | |
parent | 29ff0bfa9f4c369b30ec8ad1a81dc567eb9dc569 (diff) |
feat(cli): allow --log-level=trace for additional deep debugging (#20426)
This allows us to opt in to extremely detailed tracing from dependency
libraries, like so:
```
cargo run --features tracing/log,tracing/max_level_trace -- test --log-level=trace -A --unstable ./cli/tests/unit/serve_test.ts
```
It will not impact normal operation as it requires the
`tracing/max_level_trace` and `tracing/log` to be active.
Note that tracing is already a dependency -- this just makes it a direct
dep of cli so we can access its features more easily.
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index c09d4e7e9..b69f1ce8f 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -796,6 +796,7 @@ pub fn flags_from_vec(args: Vec<String>) -> clap::error::Result<Flags> { flags.log_level = Some(Level::Error); } else if let Some(log_level) = matches.get_one::<String>("log-level") { flags.log_level = match log_level.as_str() { + "trace" => Some(Level::Trace), "debug" => Some(Level::Debug), "info" => Some(Level::Info), _ => unreachable!(), @@ -891,7 +892,7 @@ fn clap_root() -> Command { .long("log-level") .help("Set log level") .hide(true) - .value_parser(["debug", "info"]) + .value_parser(["trace", "debug", "info"]) .global(true), ) .arg( |