Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: remove misleading doc #2220

Merged
merged 2 commits into from Jul 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 4 additions & 20 deletions tracing/src/collect.rs
Expand Up @@ -5,16 +5,8 @@ pub use tracing_core::collect::*;
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub use tracing_core::dispatch::DefaultGuard;

/// Sets this collector as the default for the duration of a closure.
///
/// The default collector is used when creating a new [`Span`] or
/// [`Event`], _if no span is currently executing_. If a span is currently
/// executing, new spans or events are dispatched to the collector that
/// tagged that span, instead.
///
/// [`Span`]: super::span::Span
/// [`Collect`]: super::collect::Collect
/// [`Event`]: tracing_core::Event
/// Sets this collector as the default for the current thread for the duration
/// of a closure.
hawkw marked this conversation as resolved.
Show resolved Hide resolved
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn with_default<T, C>(collector: C, f: impl FnOnce() -> T) -> T
Expand Down Expand Up @@ -43,16 +35,8 @@ where
crate::dispatch::set_global_default(crate::Dispatch::new(collector))
}

/// Sets the collector as the default for the duration of the lifetime of the
/// returned [`DefaultGuard`]
///
/// The default collector is used when creating a new [`Span`] or
/// [`Event`], _if no span is currently executing_. If a span is currently
/// executing, new spans or events are dispatched to the collector that
/// tagged that span, instead.
///
/// [`Span`]: super::span::Span
/// [`Event`]: tracing_core::Event
/// Sets the collector as the default for the current thread for the duration of
/// the lifetime of the returned [`DefaultGuard`].
hawkw marked this conversation as resolved.
Show resolved Hide resolved
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
#[must_use = "Dropping the guard unregisters the collector."]
Expand Down