Skip to content

Commit 964c083

Browse files
committed
doc(logging): update mentions of log to tracing
1 parent 9d707e4 commit 964c083

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/doc/contrib/src/implementation/debugging.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## Logging
44

5-
Cargo uses the [`env_logger`] crate to display debug log messages. The
6-
`CARGO_LOG` environment variable can be set to enable debug logging, with a
7-
value such as `trace`, `debug`, or `warn`. It also supports filtering for
8-
specific modules. Feel free to use the standard [`log`] macros to help with
9-
diagnosing problems.
5+
Cargo uses the [`tracing`] crate to display debug log messages.
6+
The `CARGO_LOG` environment variable can be set to enable debug logging, with a value such as `trace`, `debug`, or `warn`.
7+
It also supports filtering for specific modules with comma-separated [directives].
8+
Feel free to use [shorthand macros] to help with diagnosing problems.
9+
We're looking forward to making Cargo logging mechanism more structural!
1010

1111
```sh
1212
# Outputs all logs with levels debug and higher
@@ -22,5 +22,6 @@ CARGO_HTTP_DEBUG=true CARGO_LOG=cargo::ops::registry=debug cargo fetch
2222
CARGO_LOG=cargo::core::compiler::fingerprint=trace cargo build
2323
```
2424

25-
[`env_logger`]: https://docs.rs/env_logger
26-
[`log`]: https://docs.rs/log
25+
[`tracing`]: https://docs.rs/tracing
26+
[directive]: https://docs.rs/tracing_subscriber/filter/struct.EnvFilter.html#directives
27+
[shorthand macros]: https://docs.rs/tracing/index.html#shorthand-macros

src/doc/src/reference/environment-variables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ with them:
99
You can override these environment variables to change Cargo's behavior on your
1010
system:
1111

12-
* `CARGO_LOG` --- Cargo uses the [`env_logger`] crate to display debug log messages.
12+
* `CARGO_LOG` --- Cargo uses the [`tracing`] crate to display debug log messages.
1313
The `CARGO_LOG` environment variable can be set to enable debug logging,
1414
with a value such as `trace`, `debug`, or `warn`.
1515
Usually it is only used during debugging. For more details refer to the
@@ -389,7 +389,7 @@ let out_dir = env::var("OUT_DIR").unwrap();
389389
the environment; scripts should use `CARGO_ENCODED_RUSTFLAGS` instead.
390390
* `CARGO_PKG_<var>` --- The package information variables, with the same names and values as are [provided during crate building][variables set for crates].
391391

392-
[`env_logger`]: https://docs.rs/env_logger
392+
[`tracing`]: https://docs.rs/tracing
393393
[debug logging]: https://doc.crates.io/contrib/architecture/console.html#debug-logging
394394
[unix-like platforms]: ../../reference/conditional-compilation.html#unix-and-windows
395395
[windows-like platforms]: ../../reference/conditional-compilation.html#unix-and-windows

0 commit comments

Comments
 (0)