mirror of
https://github.com/tokio-rs/tracing.git
synced 2025-09-28 05:21:57 +00:00
subscriber: fix missing doc(cfg(...))
attributes for EnvFilter
(#1544)
## Motivation Currently, some types in the `filter` module that require the "env-filter" feature flag don't properly show in the docs that they require this feature. This is because the `doc(cfg(feature = "env-filter"))` attribute is only placed on the _re-export_ from the `env` module (and on the `EnvFilter` type), not on the individual types that are re-exported. However, placing a `doc(cfg(...))` attribute on a re-export doesn't actually do anything. ## Solution This commit fixes that.
This commit is contained in:
parent
c95321a02e
commit
a1d1282086
@ -8,6 +8,7 @@ use tracing_core::{span, Level, Metadata};
|
||||
/// A single filtering directive.
|
||||
// TODO(eliza): add a builder for programmatically constructing directives?
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "env-filter")))]
|
||||
pub struct Directive {
|
||||
in_span: Option<String>,
|
||||
fields: FilterVec<field::Match>,
|
||||
|
1
tracing-subscriber/src/filter/env/field.rs
vendored
1
tracing-subscriber/src/filter/env/field.rs
vendored
@ -115,6 +115,7 @@ pub(crate) struct MatchPattern {
|
||||
|
||||
/// Indicates that a field name specified in a filter directive was invalid.
|
||||
#[derive(Clone, Debug)]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "env-filter")))]
|
||||
pub struct BadName {
|
||||
name: String,
|
||||
}
|
||||
|
1
tracing-subscriber/src/filter/env/mod.rs
vendored
1
tracing-subscriber/src/filter/env/mod.rs
vendored
@ -119,6 +119,7 @@ type FilterVec<T> = Vec<T>;
|
||||
|
||||
/// Indicates that an error occurred while parsing a `EnvFilter` from an
|
||||
/// environment variable.
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "env-filter")))]
|
||||
#[derive(Debug)]
|
||||
pub struct FromEnvError {
|
||||
kind: ErrorKind,
|
||||
|
Loading…
x
Reference in New Issue
Block a user