Skip to content

Commit 3b75c20

Browse files
committed
finish doc_cfg for tracing-log
1 parent 3e1979b commit 3b75c20

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tracing-log/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
//! [`Subscriber`]: https://docs.rs/tracing/latest/tracing/trait.Subscriber.html
8888
//! [`tracing::Event`]: https://docs.rs/tracing/latest/tracing/struct.Event.html
8989
#![doc(html_root_url = "https://docs.rs/tracing-log/0.1.1")]
90+
#![cfg_attr(docsrs, feature(doc_cfg))]
9091
#![warn(
9192
missing_debug_implementations,
9293
missing_docs,
@@ -123,16 +124,20 @@ use tracing_core::{
123124
};
124125

125126
#[cfg(feature = "log-tracer")]
127+
#[cfg_attr(docsrs, doc(cfg(feature = "log-tracer")))]
126128
pub mod log_tracer;
127129

128130
#[cfg(feature = "trace-logger")]
131+
#[cfg_attr(docsrs, doc(cfg(feature = "trace-logger")))]
129132
pub mod trace_logger;
130133

131134
#[cfg(feature = "log-tracer")]
135+
#[cfg_attr(docsrs, doc(cfg(feature = "log-tracer")))]
132136
#[doc(inline)]
133137
pub use self::log_tracer::LogTracer;
134138

135139
#[cfg(feature = "trace-logger")]
140+
#[cfg_attr(docsrs, doc(cfg(feature = "trace-logger")))]
136141
#[deprecated(
137142
since = "0.1.1",
138143
note = "use the `tracing` crate's \"log\" feature flag instead"
@@ -142,6 +147,7 @@ pub use self::log_tracer::LogTracer;
142147
pub use self::trace_logger::TraceLogger;
143148

144149
#[cfg(feature = "env_logger")]
150+
#[cfg_attr(docsrs, doc(cfg(feature = "env_logger")))]
145151
pub mod env_logger;
146152

147153
/// Format a log record as a trace event in the current span.

tracing-log/src/log_tracer.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ impl LogTracer {
112112
///
113113
/// [`builder`]: #method.builder
114114
#[cfg(feature = "std")]
115+
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
115116
pub fn init_with_filter(level: log::LevelFilter) -> Result<(), SetLoggerError> {
116117
Self::builder().with_max_level(level).init()
117118
}
@@ -146,6 +147,7 @@ impl LogTracer {
146147
/// [`init_with_filter`]: #method.init_with_filter
147148
/// [`builder`]: #method.builder
148149
#[cfg(feature = "std")]
150+
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
149151
pub fn init() -> Result<(), SetLoggerError> {
150152
Self::builder().init()
151153
}
@@ -241,6 +243,7 @@ impl Builder {
241243
///
242244
/// Setting a global logger can only be done once.
243245
#[cfg(feature = "std")]
246+
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
244247
pub fn init(self) -> Result<(), SetLoggerError> {
245248
let ignore_crates = self.ignore_crates.into_boxed_slice();
246249
let logger = Box::new(LogTracer { ignore_crates });

0 commit comments

Comments
 (0)