|
89 | 89 | //!
|
90 | 90 | //! ## Enabling logging
|
91 | 91 | //!
|
92 |
| -//! Log levels are controlled on a per-module basis, and by default all logging |
93 |
| -//! is disabled except for `error!`. Logging is controlled via the **`RUST_LOG`** |
94 |
| -//! environment variable. The value of this environment variable is a |
95 |
| -//! comma-separated list of logging directives. A logging directive is of the |
96 |
| -//! form: |
| 92 | +//! Log levels are controlled on a per-module basis, and **by default all |
| 93 | +//! logging is disabled except for the `error` level**. |
| 94 | +//! |
| 95 | +//! Logging is controlled via the **`RUST_LOG`** environment variable. The |
| 96 | +//! value of this environment variable is a comma-separated list of logging |
| 97 | +//! directives. A logging directive is of the form: |
97 | 98 | //!
|
98 | 99 | //! ```text
|
99 | 100 | //! path::to::module=level
|
|
105 | 106 | //! Furthermore, this path is a prefix-search, so all modules nested in the
|
106 | 107 | //! specified module will also have logging enabled.
|
107 | 108 | //!
|
108 |
| -//! The actual `level` is optional to specify. If omitted, all logging will |
109 |
| -//! be enabled. If specified, it must be one of the strings `debug`, `error`, |
110 |
| -//! `info`, `warn`, or `trace`. The letter case is not significant for the |
111 |
| -//! logging level names; e.g., `debug`, `DEBUG`, and `dEbuG` all represent the |
112 |
| -//! same logging level. |
| 109 | +//! When providing the crate name or a module path, explicitly specifying the |
| 110 | +//! log level is optional. If omitted, all logging for the item (and its |
| 111 | +//! children) will be enabled. |
| 112 | +//! |
| 113 | +//! When specifying a logging level, the name provided must be one of the |
| 114 | +//! strings `debug`, `error`, `info`, `warn`, or `trace`. The letter case is |
| 115 | +//! not significant for the logging level names; e.g., `debug`, `DEBUG`, and |
| 116 | +//! `dEbuG` all represent the same logging level. |
113 | 117 | //!
|
114 | 118 | //! As the log level for a module is optional, the module to enable logging for
|
115 |
| -//! is also optional. If only a `level` is provided, then the global log |
116 |
| -//! level for all modules is set to this value. |
| 119 | +//! is also optional. **If only a level is provided, then the global log |
| 120 | +//! level for all modules is set to this value.** |
117 | 121 | //!
|
118 | 122 | //! Some examples of valid values of `RUST_LOG` are:
|
119 | 123 | //!
|
|
0 commit comments