|
109 | 109 | //! subscriber (`JsonSubscriber` in the above example) to record serialized
|
110 | 110 | //! trace data.
|
111 | 111 | //!
|
| 112 | +//! ### Unstable Features |
| 113 | +//! |
| 114 | +//! These feature flags enable **unstable** features. The public API may break in 0.1.x |
| 115 | +//! releases. To enable these features, the `--cfg tracing_unstable` must be passed to |
| 116 | +//! `rustc` when compiling. |
| 117 | +//! |
| 118 | +//! The following unstable feature flags are currently available: |
| 119 | +//! |
| 120 | +//! * `valuable`: Enables [`Visit::record_value`] implementations, for |
| 121 | +//! serializing values recorded using the [`valuable`] crate. |
| 122 | +//! |
| 123 | +//! #### Enabling Unstable Features |
| 124 | +//! |
| 125 | +//! The easiest way to set the `tracing_unstable` cfg is to use the `RUSTFLAGS` |
| 126 | +//! env variable when running `cargo` commands: |
| 127 | +//! |
| 128 | +//! ```shell |
| 129 | +//! RUSTFLAGS="--cfg tracing_unstable" cargo build |
| 130 | +//! ``` |
| 131 | +//! Alternatively, the following can be added to the `.cargo/config` file in a |
| 132 | +//! project to automatically enable the cfg flag for that project: |
| 133 | +//! |
| 134 | +//! ```toml |
| 135 | +//! [build] |
| 136 | +//! rustflags = ["--cfg", "tracing_unstable"] |
| 137 | +//! ``` |
| 138 | +//! |
| 139 | +//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section |
| 140 | +//! [`valuable`]: https://crates.io/crates/valuable |
| 141 | +//! |
112 | 142 | //! ## Supported Rust Versions
|
113 | 143 | //!
|
114 | 144 | //! Tracing is built against the latest stable release. The minimum supported
|
|
130 | 160 | html_logo_url = "https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png",
|
131 | 161 | issue_tracker_base_url = "https://github.com/tokio-rs/tracing/issues/"
|
132 | 162 | )]
|
| 163 | +#![cfg_attr(docsrs, feature(doc_cfg))] |
133 | 164 | #![cfg_attr(docsrs, deny(rustdoc::broken_intra_doc_links))]
|
134 | 165 | #![warn(
|
135 | 166 | missing_debug_implementations,
|
@@ -357,6 +388,7 @@ where
|
357 | 388 | S: SerializeMap,
|
358 | 389 | {
|
359 | 390 | #[cfg(all(tracing_unstable, feature = "valuable"))]
|
| 391 | + #[cfg_attr(docsrs, doc(cfg(all(tracing_unstable, feature = "valuable"))))] |
360 | 392 | fn record_value(&mut self, field: &Field, value: valuable_crate::Value<'_>) {
|
361 | 393 | if self.state.is_ok() {
|
362 | 394 | self.state = self
|
@@ -418,6 +450,7 @@ where
|
418 | 450 | S: SerializeStruct,
|
419 | 451 | {
|
420 | 452 | #[cfg(all(tracing_unstable, feature = "valuable"))]
|
| 453 | + #[cfg_attr(docsrs, doc(cfg(all(tracing_unstable, feature = "valuable"))))] |
421 | 454 | fn record_value(&mut self, field: &Field, value: valuable_crate::Value<'_>) {
|
422 | 455 | if self.state.is_ok() {
|
423 | 456 | self.state = self
|
|
0 commit comments