Commit 41a3524
subscriber: correct fmt::init() documentation (tokio-rs#2224)
## Motivation
Previously the documentation for `fmt::init()` was misleading. It stated
that it was shorthand for `fmt().init()`. This lead to confusion as
users would expect the same behavior from both. However `fmt::init()`
would, whether you used the env-filter feature or not, rely on RUST_LOG
to set the tracing level. `fmt().init()` does not do this and it must be
set with a specific configuration via `with_env_filter`.
## Solution
The documentation has been updated to no longer state that it is 1:1
shorthand for the other. The documentation now specifically points out
that you must be using the `env-filter` feature and gives a correct
example to mimic the `fmt::init()` behavior using `fmt().init()`.
Fixes tokio-rs#2217
Fixes tokio-rs#1329
Co-authored-by: Eliza Weisman <eliza@buoyant.io>1 parent 7253241 commit 41a3524
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1239 | 1239 | | |
1240 | 1240 | | |
1241 | 1241 | | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
1242 | 1245 | | |
1243 | 1246 | | |
1244 | 1247 | | |
1245 | | - | |
| 1248 | + | |
1246 | 1249 | | |
1247 | 1250 | | |
1248 | | - | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
1249 | 1255 | | |
1250 | 1256 | | |
1251 | 1257 | | |
| |||
0 commit comments