rework log verbosity (-vvv) (#11758)

Reworks how log verbosity flags work.

* `<no argument>` is the same, equivalent to `RUST_LOG=off`
* `-v` is the same, equivalent to `RUST_LOG=uv=debug`
* `-vv` is now equivalent to `RUST_LOG=uv=trace` (previously it only
enabled more log message context)
* `-vvv` is now equivalent to `RUST_LOG=trace` (previously it was
equivalent to `-vv`)

The "more context" that `-vv` had has been moved to an orthogonal
setting via an environment variable. Setting `UV_LOG_CONTEXT=1` will add
the extra context that `-vv` did.

In the future we may make these more granular as we try to use
`info!/warn!` more.

Fixes #1569
This commit is contained in:
Aria Desires 2025-02-28 18:49:27 -05:00 committed by GitHub
parent dc39d6622b
commit 7acdbf6414
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 63 additions and 47 deletions

View file

@ -173,6 +173,12 @@ a link mode.
Equivalent to the `--locked` command-line argument. If set, uv will assert that the
`uv.lock` remains unchanged.
### `UV_LOG_CONTEXT`
Add additional context and structure to log messages.
If logging is not enabled, e.g., with `RUST_LOG` or `-v`, this has no effect.
### `UV_NATIVE_TLS`
Equivalent to the `--native-tls` command-line argument. If set to `true`, uv will