diff --git a/tracing-appender/src/lib.rs b/tracing-appender/src/lib.rs index 55ad31c4b1..d21148eaea 100644 --- a/tracing-appender/src/lib.rs +++ b/tracing-appender/src/lib.rs @@ -91,9 +91,9 @@ //! [write]: https://doc.rust-lang.org/std/io/trait.Write.html //! [non_blocking]: mod@non_blocking //! [guard]: non_blocking::WorkerGuard -//! [make_writer]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/trait.MakeWriter.html +//! [make_writer]: tracing_subscriber::fmt::MakeWriter //! [`RollingFileAppender`]: rolling::RollingFileAppender -//! [fmt_subscriber]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/struct.Subscriber.html +//! [fmt_subscriber]: tracing_subscriber::fmt::Subscriber //! //! ## Non-Blocking Rolling File Appender //! diff --git a/tracing-appender/src/non_blocking.rs b/tracing-appender/src/non_blocking.rs index a8c765d6f5..682baa058c 100644 --- a/tracing-appender/src/non_blocking.rs +++ b/tracing-appender/src/non_blocking.rs @@ -119,8 +119,8 @@ pub struct WorkerGuard { /// crate. Therefore, it can be used with the [`tracing_subscriber::fmt`][fmt] module /// or with any other subscriber/layer implementation that uses the `MakeWriter` trait. /// -/// [make_writer]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/trait.MakeWriter.html -/// [fmt]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/index.html +/// [make_writer]: tracing_subscriber::fmt::MakeWriter +/// [fmt]: mod@tracing_subscriber::fmt #[derive(Clone, Debug)] pub struct NonBlocking { error_counter: Arc, diff --git a/tracing-core/src/collect.rs b/tracing-core/src/collect.rs index 2a56bbefbe..39d4d111ad 100644 --- a/tracing-core/src/collect.rs +++ b/tracing-core/src/collect.rs @@ -388,7 +388,7 @@ pub trait Collect: 'static { /// inside of a `try_close` function may cause a double panic, if the span /// was dropped due to a thread unwinding. /// - /// [span ID]: super::span::Id + /// [`span ID`]: super::span::Id /// [`clone_span`]: Collect::clone_span /// [`drop_span`]: Collect::drop_span fn try_close(&self, id: span::Id) -> bool { diff --git a/tracing-error/src/backtrace.rs b/tracing-error/src/backtrace.rs index e00d3168e4..544053b147 100644 --- a/tracing-error/src/backtrace.rs +++ b/tracing-error/src/backtrace.rs @@ -55,9 +55,9 @@ use tracing::{Metadata, Span}; /// /// [`tracing`]: https://docs.rs/tracing /// [`Backtrace`]: https://doc.rust-lang.org/std/backtrace/struct.Backtrace.html -/// [span]: https://docs.rs/tracing/latest/tracing/span/index.html -/// [parents]: https://docs.rs/tracing/latest/tracing/span/index.html#span-relationships -/// [fields]: https://docs.rs/tracing/latest/tracing/field/index.html +/// [span]: mod@tracing::span +/// [parents]: mod@tracing::span#span-relationships +/// [fields]: tracing::field /// [futures]: https://doc.rust-lang.org/std/future/trait.Future.html /// [`tracing-futures`]: https://docs.rs/tracing-futures/ /// [`with_spans`]: SpanTrace::with_spans() @@ -111,8 +111,8 @@ impl SpanTrace { /// indicate whether to continue iterating over spans; if it returns /// `false`, no additional spans will be visited. /// - /// [fields]: https://docs.rs/tracing/latest/tracing/field/index.html - /// [`Metadata`]: https://docs.rs/tracing/latest/tracing/struct.Metadata.html + /// [fields]: tracing::field + /// [`Metadata`]: tracing::Metadata pub fn with_spans(&self, f: impl FnMut(&'static Metadata<'static>, &str) -> bool) { self.span.with_collector(|(id, s)| { if let Some(getcx) = s.downcast_ref::() { diff --git a/tracing-error/src/layer.rs b/tracing-error/src/layer.rs index fbc2ff09bb..1b75cdef7d 100644 --- a/tracing-error/src/layer.rs +++ b/tracing-error/src/layer.rs @@ -15,10 +15,10 @@ use tracing_subscriber::{ /// when formatting the fields of each span in a trace. When no formatter is /// provided, the [default format] is used instead. /// -/// [subscriber]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/subscriber/trait.Subscribe.html +/// [subscriber]: tracing_subscriber::subscribe::Subscribe /// [`SpanTrace`]: super::SpanTrace -/// [field formatter]: https://docs.rs/tracing-subscriber/0.2.10/tracing_subscriber/fmt/trait.FormatFields.html -/// [default format]: https://docs.rs/tracing-subscriber/0.2.10/tracing_subscriber/fmt/format/struct.DefaultFields.html +/// [field formatter]: tracing_subscriber::fmt::FormatFields +/// [default format]: tracing_subscriber::fmt::format::DefaultFields pub struct ErrorSubscriber { format: F, @@ -75,7 +75,7 @@ where { /// Returns a new `ErrorSubscriber` with the provided [field formatter]. /// - /// [field formatter]: https://docs.rs/tracing-subscriber/0.2.10/tracing_subscriber/fmt/trait.FormatFields.html + /// [field formatter]: tracing_subscriber::fmt::FormatFields pub fn new(format: F) -> Self { Self { format, diff --git a/tracing-error/src/lib.rs b/tracing-error/src/lib.rs index a76ea9517f..9039be2510 100644 --- a/tracing-error/src/lib.rs +++ b/tracing-error/src/lib.rs @@ -158,10 +158,10 @@ //! ``` //! //! [`in_current_span()`]: InstrumentResult::in_current_span -//! [span]: https://docs.rs/tracing/latest/tracing/span/index.html -//! [events]: https://docs.rs/tracing/latest/tracing/struct.Event.html -//! [collector]: https://docs.rs/tracing/latest/tracing/trait.Collect.html -//! [subscriber layer]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/layer/trait.Layer.html +//! [span]: mod@tracing::span +//! [events]: tracing::Event +//! [collector]: tracing::Collect +//! [subscriber layer]: tracing_subscriber::subscribe::Subscribe //! [`tracing`]: https://docs.rs/tracing //! [`std::error::Error`]: https://doc.rust-lang.org/stable/std/error/trait.Error.html //! diff --git a/tracing-futures/src/lib.rs b/tracing-futures/src/lib.rs index 47aad0183e..014e229598 100644 --- a/tracing-futures/src/lib.rs +++ b/tracing-futures/src/lib.rs @@ -53,8 +53,8 @@ //! The `tokio`, `std-future` and `std` features are enabled by default. //! //! [`tracing`]: https://crates.io/crates/tracing -//! [span]: https://docs.rs/tracing/latest/tracing/span/index.html -//! [collector]: https://docs.rs/tracing/latest/tracing/collect/index.html +//! [span]: mod@tracing::span +//! [collector]: tracing::collect //! [`futures`]: https://crates.io/crates/futures //! //! ## Supported Rust Versions @@ -118,7 +118,7 @@ pub mod executor; /// Extension trait allowing futures, streams, sinks, and executors to be /// instrumented with a `tracing` [span]. /// -/// [span]: https://docs.rs/tracing/latest/tracing/span/index.html +/// [span]: mod@tracing::span pub trait Instrument: Sized { /// Instruments this type with the provided `Span`, returning an /// `Instrumented` wrapper. @@ -147,7 +147,7 @@ pub trait Instrument: Sized { /// # } /// ``` /// - /// [entered]: https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.enter + /// [entered]: tracing::span::Span::enter() fn instrument(self, span: Span) -> Instrumented { Instrumented { inner: self, span } } @@ -182,8 +182,8 @@ pub trait Instrument: Sized { /// # } /// ``` /// - /// [current]: https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current - /// [entered]: https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.enter + /// [current]: tracing::span::Span::current() + /// [entered]: tracing::span::Span::enter() #[inline] fn in_current_span(self) -> Instrumented { self.instrument(Span::current()) @@ -193,7 +193,7 @@ pub trait Instrument: Sized { /// Extension trait allowing futures, streams, and sinks to be instrumented with /// a `tracing` [collector]. /// -/// [collector]: https://docs.rs/tracing/latest/tracing/collect/trait.Collect.html +/// [collector]: tracing::collect::Collect #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] pub trait WithCollector: Sized { @@ -205,8 +205,8 @@ pub trait WithCollector: Sized { /// When the wrapped type is an executor, the subscriber will be set as the /// default for any futures spawned on that executor. /// - /// [collector]: https://docs.rs/tracing/latest/tracing/collect/trait.Collect.html - /// [default]: https://docs.rs/tracing/latest/tracing/dispatcher/index.html#setting-the-default-subscriber + /// [collector]: tracing::collect::Collect + /// [default]: tracing::dispatch#setting-the-default-collector fn with_collector(self, collector: S) -> WithDispatch where S: Into, @@ -228,8 +228,8 @@ pub trait WithCollector: Sized { /// This can be used to propagate the current dispatcher context when /// spawning a new future. /// - /// [collector]: https://docs.rs/tracing/latest/tracing/collect/trait.Collect.html - /// [default]: https://docs.rs/tracing/latest/tracing/dispatcher/index.html#setting-the-default-subscriber + /// [collector]: tracing::collect::Collect + /// [default]: tracing::dispatch#setting-the-default-collector #[inline] fn with_current_collector(self) -> WithDispatch { WithDispatch { diff --git a/tracing-journald/src/lib.rs b/tracing-journald/src/lib.rs index 254136c946..af90ac9435 100644 --- a/tracing-journald/src/lib.rs +++ b/tracing-journald/src/lib.rs @@ -15,7 +15,7 @@ //! //! [msrv]: #supported-rust-versions //! [`tracing`]: https://crates.io/crates/tracing -//! [subscriber]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/subscriber/trait.Subscriber.html +//! [subscriber]: tracing_subscriber::subscribe::Subscribe //! [journald]: https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html //! //! ## Supported Rust Versions diff --git a/tracing-log/src/lib.rs b/tracing-log/src/lib.rs index 65693d2479..8795da2dbb 100644 --- a/tracing-log/src/lib.rs +++ b/tracing-log/src/lib.rs @@ -92,8 +92,6 @@ //! [`tracing`]: https://crates.io/crates/tracing //! [`log`]: https://crates.io/crates/log //! [`env_logger` crate]: https://crates.io/crates/env-logger -//! [`log::Log`]: https://docs.rs/log/latest/log/trait.Log.html -//! [`log::Record`]: https://docs.rs/log/latest/log/struct.Record.html //! [`tracing::Collector`]: https://docs.rs/tracing/latest/tracing/trait.Collect.html //! [`Collect`]: https://docs.rs/tracing/latest/tracing/trait.Collect.html //! [`tracing::Event`]: https://docs.rs/tracing/latest/tracing/struct.Event.html @@ -376,7 +374,6 @@ impl AsTrace for log::Level { /// regardless of the source of its source. /// /// [`normalized_metadata`]: trait.NormalizeEvent.html#normalized_metadata -/// [`log::Record`]: https://docs.rs/log/0.4.7/log/struct.Record.html pub trait NormalizeEvent<'a>: crate::sealed::Sealed { /// If this `Event` comes from a `log`, this method provides a new /// normalized `Metadata` which has all available attributes diff --git a/tracing-log/src/log_tracer.rs b/tracing-log/src/log_tracer.rs index a6becf5be6..cadf61a285 100644 --- a/tracing-log/src/log_tracer.rs +++ b/tracing-log/src/log_tracer.rs @@ -20,7 +20,7 @@ //! default. //! //! [`log`]: https://docs.rs/log/0.4.8/log/ -//! [logger interface]: https://docs.rs/log/0.4.8/log/trait.Log.html +//! [logger interface]: log::Log //! [`init`]: LogTracer.html#method.init //! [`init_with_filter`]: LogTracer.html#method.init_with_filter //! [builder]: LogTracer::builder() diff --git a/tracing-opentelemetry/src/layer.rs b/tracing-opentelemetry/src/layer.rs index 5e16aca920..f08e854ec2 100644 --- a/tracing-opentelemetry/src/layer.rs +++ b/tracing-opentelemetry/src/layer.rs @@ -105,7 +105,7 @@ struct SpanEventVisitor<'a>(&'a mut api::Event); impl<'a> field::Visit for SpanEventVisitor<'a> { /// Record events on the underlying OpenTelemetry [`Span`] from `bool` values. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn record_bool(&mut self, field: &field::Field, value: bool) { match field.name() { "message" => self.0.name = value.to_string(), @@ -120,7 +120,7 @@ impl<'a> field::Visit for SpanEventVisitor<'a> { /// Record events on the underlying OpenTelemetry [`Span`] from `i64` values. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn record_i64(&mut self, field: &field::Field, value: i64) { match field.name() { "message" => self.0.name = value.to_string(), @@ -135,7 +135,7 @@ impl<'a> field::Visit for SpanEventVisitor<'a> { /// Record events on the underlying OpenTelemetry [`Span`] from `u64` values. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn record_u64(&mut self, field: &field::Field, value: u64) { match field.name() { "message" => self.0.name = value.to_string(), @@ -150,7 +150,7 @@ impl<'a> field::Visit for SpanEventVisitor<'a> { /// Record events on the underlying OpenTelemetry [`Span`] from `&str` values. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn record_str(&mut self, field: &field::Field, value: &str) { match field.name() { "message" => self.0.name = value.to_string(), @@ -166,7 +166,7 @@ impl<'a> field::Visit for SpanEventVisitor<'a> { /// Record events on the underlying OpenTelemetry [`Span`] from values that /// implement Debug. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn record_debug(&mut self, field: &field::Field, value: &dyn fmt::Debug) { match field.name() { "message" => self.0.name = format!("{:?}", value), @@ -187,7 +187,7 @@ struct SpanAttributeVisitor<'a>(&'a mut api::SpanBuilder); impl<'a> field::Visit for SpanAttributeVisitor<'a> { /// Set attributes on the underlying OpenTelemetry [`Span`] from `bool` values. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn record_bool(&mut self, field: &field::Field, value: bool) { let attribute = api::KeyValue::new(field.name(), value); if let Some(attributes) = &mut self.0.attributes { @@ -199,7 +199,7 @@ impl<'a> field::Visit for SpanAttributeVisitor<'a> { /// Set attributes on the underlying OpenTelemetry [`Span`] from `i64` values. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn record_i64(&mut self, field: &field::Field, value: i64) { let attribute = api::KeyValue::new(field.name(), value); if let Some(attributes) = &mut self.0.attributes { @@ -211,7 +211,7 @@ impl<'a> field::Visit for SpanAttributeVisitor<'a> { /// Set attributes on the underlying OpenTelemetry [`Span`] from `u64` values. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn record_u64(&mut self, field: &field::Field, value: u64) { let attribute = api::KeyValue::new(field.name(), value); if let Some(attributes) = &mut self.0.attributes { @@ -223,7 +223,7 @@ impl<'a> field::Visit for SpanAttributeVisitor<'a> { /// Set attributes on the underlying OpenTelemetry [`Span`] from `&str` values. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn record_str(&mut self, field: &field::Field, value: &str) { if field.name() == SPAN_NAME_FIELD { self.0.name = value.to_string(); @@ -242,7 +242,7 @@ impl<'a> field::Visit for SpanAttributeVisitor<'a> { /// Set attributes on the underlying OpenTelemetry [`Span`] from values that /// implement Debug. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn record_debug(&mut self, field: &field::Field, value: &dyn fmt::Debug) { if field.name() == SPAN_NAME_FIELD { self.0.name = format!("{:?}", value); @@ -267,8 +267,8 @@ where /// Set the [`Tracer`] that this layer will use to produce and track /// OpenTelemetry [`Span`]s. /// - /// [`Tracer`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/tracer/trait.Tracer.html - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Tracer`]: opentelemetry::api::trace::tracer::Tracer + /// [`Span`]: opentelemetry::api::trace::span::Span /// /// # Examples /// @@ -318,8 +318,8 @@ where /// Set the [`Tracer`] that this layer will use to produce and track /// OpenTelemetry [`Span`]s. /// - /// [`Tracer`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/tracer/trait.Tracer.html - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Tracer`]: opentelemetry::api::trace::tracer::Tracer + /// [`Span`]: opentelemetry::api::trace::span::Span /// /// # Examples /// @@ -373,9 +373,9 @@ where /// tracing [`span`] through the [`Registry`]. This [`SpanContext`] /// links spans to their parent for proper hierarchical visualization. /// - /// [`SpanContext`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span_context/struct.SpanContext.html - /// [`span`]: https://docs.rs/tracing/latest/tracing/struct.Span.html - /// [`Registry`]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/struct.Registry.html + /// [`SpanContext`]: opentelemetry::api::trace::span_context::SpanContext + /// [`span`]: tracing::Span + /// [`Registry`]: tracing_subscriber::Registry fn parent_span_context( &self, attrs: &Attributes<'_>, @@ -431,8 +431,8 @@ where { /// Creates an [OpenTelemetry `Span`] for the corresponding [tracing `Span`]. /// - /// [OpenTelemetry `Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html - /// [tracing `Span`]: https://docs.rs/tracing/latest/tracing/struct.Span.html + /// [OpenTelemetry `Span`]: opentelemetry::api::trace::span::Span + /// [tracing `Span`]: tracing::Span fn new_span(&self, attrs: &Attributes<'_>, id: &span::Id, ctx: Context<'_, S>) { let span = ctx.span(id).expect("Span not found, this is a bug"); let mut extensions = span.extensions_mut(); @@ -463,7 +463,7 @@ where /// Record OpenTelemetry [`attributes`] for the given values. /// - /// [`attributes`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/tracer/struct.SpanBuilder.html#structfield.attributes + /// [`attributes`]: opentelemetry::api::trace::tracer::SpanBuilder::attributes fn on_record(&self, id: &Id, values: &Record<'_>, ctx: Context<'_, S>) { let span = ctx.span(id).expect("Span not found, this is a bug"); let mut extensions = span.extensions_mut(); @@ -501,9 +501,9 @@ where /// Note: an [`ERROR`]-level event will also set the OpenTelemetry span status code to /// [`Unknown`], signaling that an error has occurred. /// - /// [`Event`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/event/struct.Event.html - /// [`ERROR`]: https://docs.rs/tracing/latest/tracing/struct.Level.html#associatedconstant.ERROR - /// [`Unknown`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/enum.StatusCode.html#variant.Unknown + /// [`Event`]: opentelemetry::api::trace::event::Event + /// [`ERROR`]: tracing::Level::ERROR + /// [`Unknown`]: opentelemetry::api::trace::span::StatusCode::Unknown fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>) { // Ignore events that are not in the context of a span if let Some(span) = ctx.lookup_current() { @@ -542,7 +542,7 @@ where /// Exports an OpenTelemetry [`Span`] on close. /// - /// [`Span`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span/trait.Span.html + /// [`Span`]: opentelemetry::api::trace::span::Span fn on_close(&self, id: span::Id, ctx: Context<'_, S>) { let span = ctx.span(&id).expect("Span not found, this is a bug"); let mut extensions = span.extensions_mut(); diff --git a/tracing-opentelemetry/src/span_ext.rs b/tracing-opentelemetry/src/span_ext.rs index 389da6d067..c0e2372bd5 100644 --- a/tracing-opentelemetry/src/span_ext.rs +++ b/tracing-opentelemetry/src/span_ext.rs @@ -5,14 +5,14 @@ use opentelemetry::api::TraceContextExt; /// Utility functions to allow tracing [`Span`]s to accept and return /// [OpenTelemetry] [`Context`]s. /// -/// [`Span`]: https://docs.rs/tracing/latest/tracing/struct.Span.html +/// [`Span`]: tracing::Span /// [OpenTelemetry]: https://opentelemetry.io -/// [`Context`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/context/struct.Context.html +/// [`Context`]: opentelemetry::api::context::Context pub trait OpenTelemetrySpanExt { /// Associates `self` with a given OpenTelemetry trace, using the provided /// parent [`Context`]. /// - /// [`Context`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/context/struct.Context.html + /// [`Context`]: opentelemetry::api::context::Context /// /// # Examples /// @@ -44,7 +44,7 @@ pub trait OpenTelemetrySpanExt { /// Extracts an OpenTelemetry [`Context`] from `self`. /// - /// [`Context`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/context/struct.Context.html + /// [`Context`]: opentelemetry::api::context::Context /// /// # Examples /// @@ -117,7 +117,7 @@ impl api::Span for CompatSpan { /// This method is used by OpenTelemetry propagators to inject span context /// information into [`Carrier`]s. /// - /// [`Carrier`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/context/propagation/trait.Carrier.html + /// [`Carrier`]: opentelemetry::api::context::propagation::Carrier fn span_context(&self) -> api::SpanContext { self.0.clone() } diff --git a/tracing-opentelemetry/src/tracer.rs b/tracing-opentelemetry/src/tracer.rs index 6a7570d298..0f56805702 100644 --- a/tracing-opentelemetry/src/tracer.rs +++ b/tracing-opentelemetry/src/tracer.rs @@ -22,9 +22,9 @@ use opentelemetry::{api, sdk}; /// /// [`OpenTelemetrySpanExt::set_parent`]: crate::OpenTelemetrySpanExt::set_parent /// [`OpenTelemetrySpanExt::context`]: crate::OpenTelemetrySpanExt::context -/// [`Tracer`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/tracer/trait.Tracer.html -/// [`SpanBuilder`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/tracer/struct.SpanBuilder.html -/// [`SpanContext`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span_context/struct.SpanContext.html +/// [`Tracer`]: opentelemetry::api::trace::tracer::Tracer +/// [`SpanBuilder`]: opentelemetry::api::trace::tracer::SpanBuilder +/// [`SpanContext`]: opentelemetry::api::trace::span_context::SpanContext pub trait PreSampledTracer { /// Produce a pre-sampled span context for the given span builder. fn sampled_span_context(&self, builder: &mut api::SpanBuilder) -> api::SpanContext; diff --git a/tracing-subscriber/src/field/delimited.rs b/tracing-subscriber/src/field/delimited.rs index c795609ce3..dff611ce8c 100644 --- a/tracing-subscriber/src/field/delimited.rs +++ b/tracing-subscriber/src/field/delimited.rs @@ -53,7 +53,7 @@ impl VisitDelimited { /// Returns a new [`Visit`] implementation that wraps `inner` so that /// each formatted field is separated by the provided `delimiter`. /// - /// [`Visit`]: https://docs.rs/tracing-core/0.1.6/tracing_core/field/trait.Visit.html + /// [`Visit`]: tracing_core::field::Visit pub fn new(delimiter: D, inner: V) -> Self { Self { delimiter, diff --git a/tracing-subscriber/src/field/mod.rs b/tracing-subscriber/src/field/mod.rs index 4970b277ce..37d87ee17f 100644 --- a/tracing-subscriber/src/field/mod.rs +++ b/tracing-subscriber/src/field/mod.rs @@ -1,7 +1,7 @@ //! Utilities for working with [fields] and [field visitors]. //! -//! [fields]: https://docs.rs/tracing-core/latest/tracing_core/field/index.html -//! [field visitors]: https://docs.rs/tracing-core/latest/tracing_core/field/trait.Visit.html +//! [fields]: tracing_core::field +//! [field visitors]: tracing_core::field::Visit use std::{fmt, io}; pub use tracing_core::field::Visit; use tracing_core::{ @@ -22,7 +22,7 @@ pub mod display; /// data to, configuration variables that determine the visitor's behavior, or /// `()` when no input is required to produce a visitor. /// -/// [visitors]: https://docs.rs/tracing-core/latest/tracing_core/field/trait.Visit.html +/// [visitors]: tracing_core::field::Visit pub trait MakeVisitor { /// The visitor type produced by this `MakeVisitor`. type Visitor: Visit; @@ -33,7 +33,7 @@ pub trait MakeVisitor { /// A [visitor] that produces output once it has visited a set of fields. /// -/// [visitor]: https://docs.rs/tracing-core/latest/tracing_core/field/trait.Visit.html +/// [visitor]: tracing_core::field::Visit pub trait VisitOutput: Visit { /// Completes the visitor, returning any output. /// @@ -82,10 +82,10 @@ pub trait VisitOutput: Visit { /// r.record(&mut visitor); /// } /// ``` -/// [visitor]: https://docs.rs/tracing-core/latest/tracing_core/field/trait.Visit.html -/// [attr]: https://docs.rs/tracing-core/latest/tracing_core/span/struct.Attributes.html -/// [rec]: https://docs.rs/tracing-core/latest/tracing_core/span/struct.Record.html -/// [event]: https://docs.rs/tracing-core/latest/tracing_core/event/struct.Event.html +/// [visitor]: tracing_core::field::Visit +/// [attr]: tracing_core::span::Attributes +/// [rec]: tracing_core::span::Record +/// [event]: tracing_core::event::Event pub trait RecordFields: crate::sealed::Sealed { /// Record all the fields in `self` with the provided `visitor`. fn record(&self, visitor: &mut dyn Visit); diff --git a/tracing-subscriber/src/filter/env/mod.rs b/tracing-subscriber/src/filter/env/mod.rs index a9852381fb..58a8356c8b 100644 --- a/tracing-subscriber/src/filter/env/mod.rs +++ b/tracing-subscriber/src/filter/env/mod.rs @@ -89,11 +89,11 @@ use tracing_core::{ /// /// [`Subscriber`]: Subscribe /// [`env_logger`]: https://docs.rs/env_logger/0.7.1/env_logger/#enabling-logging -/// [`Span`]: https://docs.rs/tracing-core/latest/tracing_core/span/index.html -/// [fields]: https://docs.rs/tracing-core/latest/tracing_core/struct.Field.html -/// [`Event`]: https://docs.rs/tracing-core/latest/tracing_core/struct.Event.html -/// [`level`]: https://docs.rs/tracing-core/latest/tracing_core/struct.Level.html -/// [`Metadata`]: https://docs.rs/tracing-core/latest/tracing_core/struct.Metadata.html +/// [`Span`]: tracing_core::span +/// [fields]: tracing_core::Field +/// [`Event`]: tracing_core::Event +/// [`level`]: tracing_core::Level +/// [`Metadata`]: tracing_core::Metadata #[cfg(feature = "env-filter")] #[cfg_attr(docsrs, doc(cfg(feature = "env-filter")))] #[derive(Debug)] @@ -199,7 +199,7 @@ impl EnvFilter { /// and events as a previous filter, but sets a different level for those /// spans and events, the previous directive is overwritten. /// - /// [`Level`]: https://docs.rs/tracing-core/latest/tracing_core/struct.Level.html + /// [`Level`]: tracing_core::Level /// /// # Examples /// diff --git a/tracing-subscriber/src/fmt/fmt_subscriber.rs b/tracing-subscriber/src/fmt/fmt_subscriber.rs index eb471341fb..3790aae757 100644 --- a/tracing-subscriber/src/fmt/fmt_subscriber.rs +++ b/tracing-subscriber/src/fmt/fmt_subscriber.rs @@ -105,7 +105,7 @@ where /// # let _ = layer.with_collector(tracing_subscriber::registry::Registry::default()); /// ``` /// [`FormatEvent`]: format::FormatEvent - /// [`Event`]: https://docs.rs/tracing/latest/tracing/struct.Event.html + /// [`Event`]: tracing::Event pub fn event_format(self, e: E2) -> Subscriber where E2: FormatEvent + 'static, @@ -247,7 +247,7 @@ where /// this formatter; they will not be recorded by other `Collector`s or by /// `Subscriber`s added to this subscriber. /// - /// [lifecycle]: https://docs.rs/tracing/latest/tracing/span/index.html#the-span-lifecycle + /// [lifecycle]: mod@tracing::span#the-span-lifecycle /// [time]: Subscriber::without_time() pub fn with_span_events(self, kind: FmtSpan) -> Self { Subscriber { diff --git a/tracing-subscriber/src/fmt/format/pretty.rs b/tracing-subscriber/src/fmt/format/pretty.rs index 920722c83a..3aa94b9b8b 100644 --- a/tracing-subscriber/src/fmt/format/pretty.rs +++ b/tracing-subscriber/src/fmt/format/pretty.rs @@ -27,9 +27,8 @@ pub struct Pretty { /// The [visitor] produced by [`Pretty`]'s [`MakeVisitor`] implementation. /// -/// [visitor]: ../../field/trait.Visit.html -/// [`DefaultFields`]: struct.DefaultFields.html -/// [`MakeVisitor`]: ../../field/trait.MakeVisitor.html +/// [visitor]: field::Visit +/// [`MakeVisitor`]: crate::field::MakeVisitor pub struct PrettyVisitor<'a> { writer: &'a mut dyn Write, is_empty: bool, diff --git a/tracing-subscriber/src/fmt/mod.rs b/tracing-subscriber/src/fmt/mod.rs index 9ac514418b..ae70ca6c81 100644 --- a/tracing-subscriber/src/fmt/mod.rs +++ b/tracing-subscriber/src/fmt/mod.rs @@ -423,7 +423,7 @@ impl Collector { /// /// This can be overridden with the [`CollectorBuilder::with_max_level`] method. /// - /// [verbosity level]: https://docs.rs/tracing-core/0.1.5/tracing_core/struct.Level.html + /// [verbosity level]: tracing_core::Level pub const DEFAULT_MAX_LEVEL: LevelFilter = LevelFilter::INFO; /// Returns a new `CollectorBuilder` for configuring a format subscriber. @@ -659,7 +659,7 @@ where /// this formatter; they will not be recorded by other `Collector`s or by /// `Subscriber`s added to this subscriber. /// - /// [lifecycle]: https://docs.rs/tracing/latest/tracing/span/index.html#the-span-lifecycle + /// [lifecycle]: mod@tracing::span#the-span-lifecycle /// [time]: CollectorBuilder::without_time() pub fn with_span_events(self, kind: format::FmtSpan) -> Self { CollectorBuilder { @@ -945,7 +945,7 @@ impl CollectorBuilder { /// .with_max_level(LevelFilter::OFF) /// .finish(); /// ``` - /// [verbosity level]: https://docs.rs/tracing-core/0.1.5/tracing_core/struct.Level.html + /// [verbosity level]: tracing_core::Level /// [`EnvFilter`]: super::filter::EnvFilter pub fn with_max_level( self, diff --git a/tracing-subscriber/src/fmt/time/mod.rs b/tracing-subscriber/src/fmt/time/mod.rs index 2b6a3f2967..e1b7609bb7 100644 --- a/tracing-subscriber/src/fmt/time/mod.rs +++ b/tracing-subscriber/src/fmt/time/mod.rs @@ -180,7 +180,6 @@ impl ChronoUtc { /// See [`chrono::format::strftime`] /// for details on the supported syntax. /// - /// [`chrono::format::strftime`]: https://docs.rs/chrono/0.4.9/chrono/format/strftime/index.html pub fn with_format(format_string: String) -> Self { ChronoUtc { format: ChronoFmtType::Custom(format_string), @@ -227,7 +226,6 @@ impl ChronoLocal { /// See [`chrono::format::strftime`] /// for details on the supported syntax. /// - /// [`chrono::format::strftime`]: https://docs.rs/chrono/0.4.9/chrono/format/strftime/index.html pub fn with_format(format_string: String) -> Self { ChronoLocal { format: ChronoFmtType::Custom(format_string), diff --git a/tracing-subscriber/src/fmt/writer.rs b/tracing-subscriber/src/fmt/writer.rs index 4d85813a29..31a367efac 100644 --- a/tracing-subscriber/src/fmt/writer.rs +++ b/tracing-subscriber/src/fmt/writer.rs @@ -16,7 +16,7 @@ use std::{fmt::Debug, io}; /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html /// [`fmt::Collector`]: super::super::fmt::Collector /// [`fmt::Subscriber`]: super::super::fmt::Subscriber -/// [`Event`]: https://docs.rs/tracing-core/0.1.5/tracing_core/event/struct.Event.html +/// [`Event`]: tracing_core::event::Event /// [`io::stdout`]: https://doc.rust-lang.org/std/io/fn.stdout.html /// [`io::stderr`]: https://doc.rust-lang.org/std/io/fn.stderr.html pub trait MakeWriter { @@ -127,7 +127,7 @@ impl MakeWriter for TestWriter { /// } /// ``` /// -/// [`Collect`]: https://docs.rs/tracing/latest/tracing/trait.Collect.html +/// [`Collect`]: tracing::Collect /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html pub struct BoxMakeWriter { inner: Box> + Send + Sync>, diff --git a/tracing-subscriber/src/lib.rs b/tracing-subscriber/src/lib.rs index 44b593a53d..171c48cc9e 100644 --- a/tracing-subscriber/src/lib.rs +++ b/tracing-subscriber/src/lib.rs @@ -60,7 +60,7 @@ //! [`fmt`]: mod@fmt //! [`registry`]: mod@registry //! [`tracing`]: https://docs.rs/tracing/latest/tracing/ -//! [`Collect`]: https://docs.rs/tracing-core/latest/tracing_core/collect/trait.Collect.html +//! [`Collect`]: tracing_core::collect::Collect //! [`EnvFilter`]: filter::EnvFilter //! [`tracing-log`]: https://crates.io/crates/tracing-log //! [`smallvec`]: https://crates.io/crates/smallvec @@ -159,7 +159,7 @@ impl CurrentSpan { /// executing, or `None` if it is not inside of a span. /// /// - /// [`Id`]: https://docs.rs/tracing/latest/tracing/span/struct.Id.html + /// [`Id`]: tracing::span::Id pub fn id(&self) -> Option { self.current.with(|current| current.last().cloned())? } diff --git a/tracing-subscriber/src/registry/mod.rs b/tracing-subscriber/src/registry/mod.rs index a64c1ad32d..c48da6a657 100644 --- a/tracing-subscriber/src/registry/mod.rs +++ b/tracing-subscriber/src/registry/mod.rs @@ -211,7 +211,7 @@ where /// Returns a list of [fields] defined by the span. /// - /// [fields]: https://docs.rs/tracing-core/latest/tracing_core/field/index.html + /// [fields]: tracing_core::field pub fn fields(&self) -> &FieldSet { self.data.metadata().fields() } diff --git a/tracing-subscriber/src/subscribe.rs b/tracing-subscriber/src/subscribe.rs index 5d818fc95b..4e6d508baf 100644 --- a/tracing-subscriber/src/subscribe.rs +++ b/tracing-subscriber/src/subscribe.rs @@ -187,13 +187,12 @@ use std::{any::TypeId, marker::PhantomData}; /// [`Interest::never()`] from its [`register_callsite`] method, filter /// evaluation will short-circuit and the span or event will be disabled. /// -/// [`Collect`]: https://docs.rs/tracing-core/latest/tracing_core/collect/trait.Collect.html -/// [span IDs]: https://docs.rs/tracing-core/latest/tracing_core/span/struct.Id.html +/// [`Collect`]: tracing_core::collect::Collect +/// [span IDs]: tracing_core::span::Id /// [the current span]: Context::current_span() /// [`register_callsite`]: Subscribe::register_callsite() /// [`enabled`]: Subscribe::enabled() /// [`on_enter`]: Subscribe::on_enter() -/// [`Interest::never()`]: https://docs.rs/tracing-core/latest/tracing_core/subscriber/struct.Interest.html#method.never pub trait Subscribe where C: Collect, @@ -201,7 +200,7 @@ where { /// Registers a new callsite with this subscriber, returning whether or not /// the subscriber is interested in being notified about the callsite, similarly - /// to [`Collector::register_callsite`]. + /// to [`Collect::register_callsite`]. /// /// By default, this returns [`Interest::always()`] if [`self.enabled`] returns /// true, or [`Interest::never()`] if it returns false. @@ -212,7 +211,7 @@ where ///
///
     /// Note: This method (and 
-    /// Subscriber::enabled) determine whether a span or event is
+    /// Subscribe::enabled) determine whether a span or event is
     /// globally enabled, not whether the individual subscriber will be
     /// notified about that span or event. This is intended to be used
     /// by subscribers that implement filtering for the entire stack. Subscribers which do
@@ -233,12 +232,9 @@ where
     /// globally enable or disable those callsites, it should always return
     /// [`Interest::always()`].
     ///
-    /// [`Interest`]: https://docs.rs/tracing-core/latest/tracing_core/struct.Interest.html
-    /// [`Collector::register_callsite`]: https://docs.rs/tracing-core/latest/tracing_core/trait.Subscriber.html#method.register_callsite
-    /// [`Interest::never()`]: https://docs.rs/tracing-core/latest/tracing_core/subscriber/struct.Interest.html#method.never
-    /// [`Interest::always()`]: https://docs.rs/tracing-core/latest/tracing_core/subscriber/struct.Interest.html#method.always
+    /// [`Interest`]: tracing_core::Interest
+    /// [`Collect::register_callsite`]: tracing_core::Collect::register_callsite()
     /// [`self.enabled`]: Subscribe::enabled()
-    /// [`Subscriber::enabled`]: Subscribe::enabled()
     /// [`on_event`]: Subscribe::on_event()
     /// [`on_enter`]: Subscribe::on_enter()
     /// [`on_exit`]: Subscribe::on_exit()
@@ -280,7 +276,7 @@ where
     /// See [the trait-level documentation] for more information on filtering
     /// with `Subscriber`s.
     ///
-    /// [`Interest`]: https://docs.rs/tracing-core/latest/tracing_core/struct.Interest.html
+    /// [`Interest`]: tracing_core::Interest
     /// [`on_event`]: Layer::on_event()
     /// [`on_enter`]: Layer::on_enter()
     /// [`on_exit`]: Layer::on_exit()
@@ -485,7 +481,7 @@ where
     ///     .with_collector(MyCollector::new());
     ///```
     ///
-    /// [`Collect`]: https://docs.rs/tracing-core/latest/tracing_core/trait.Collect.html
+    /// [`Collect`]: tracing_core::Collect
     fn with_collector(self, inner: C) -> Layered
     where
         Self: Sized,
@@ -552,7 +548,7 @@ pub struct Context<'a, S> {
 /// [subscriber]s.
 ///
 /// [subscriber]: super::subscribe::Subscribe
-/// [collector]: https://docs.rs/tracing-core/latest/tracing_core/trait.Collect.html
+/// [collector]: tracing_core::Collect
 #[derive(Clone, Debug)]
 pub struct Layered {
     subscriber: S,
@@ -976,8 +972,8 @@ where
     ///   check whether the event would be enabled. This allows `Collectors`s to
     ///   elide constructing the event if it would not be recorded.
     ///
-    /// [register]: https://docs.rs/tracing-core/latest/tracing_core/collect/trait.Collect.html#method.register_callsite
-    /// [`enabled`]: https://docs.rs/tracing-core/latest/tracing_core/collect/trait.Collect.html#method.enabled
+    /// [register]: tracing_core::collect::Collect::register_callsite()
+    /// [`enabled`]: tracing_core::collect::Collect::enabled()
     /// [`Context::enabled`]: Layered::enabled()
     #[inline]
     pub fn event(&self, event: &Event<'_>) {
diff --git a/tracing-subscriber/src/util.rs b/tracing-subscriber/src/util.rs
index 49a3c0357f..870ca0549e 100644
--- a/tracing-subscriber/src/util.rs
+++ b/tracing-subscriber/src/util.rs
@@ -14,8 +14,8 @@ use tracing_core::dispatch::{self, Dispatch};
 /// `Collector`, may implement `Into`, and will also receive an
 /// implementation of this trait.
 ///
-/// [default subscriber]: https://docs.rs/tracing/0.1.21/tracing/dispatcher/index.html#setting-the-default-subscriber
-/// [trace dispatcher]: https://docs.rs/tracing/0.1.21/tracing/dispatcher/index.html
+/// [default subscriber]: tracing::dispatch#setting-the-default-collector
+/// [trace dispatcher]: tracing::dispatch
 pub trait SubscriberInitExt
 where
     Self: Into,
@@ -27,7 +27,7 @@ where
     /// a [`log`] compatibility layer. This allows the subscriber to consume
     /// `log::Record`s as though they were `tracing` `Event`s.
     ///
-    /// [default subscriber]: https://docs.rs/tracing/0.1.21/tracing/dispatcher/index.html#setting-the-default-subscriber
+    /// [default subscriber]: tracing::dispatch#setting-the-default-collector
     /// [`log`]: https://crates.io/log
     fn set_default(self) -> dispatch::DefaultGuard {
         #[cfg(feature = "tracing-log")]
@@ -47,7 +47,7 @@ where
     /// been set, or if a `log` logger has already been set (when the
     /// "tracing-log" feature is enabled).
     ///
-    /// [global default subscriber]: https://docs.rs/tracing/0.1.21/tracing/dispatcher/index.html#setting-the-default-subscriber
+    /// [global default subscriber]: tracing::dispatch#setting-the-default-collector
     /// [`log`]: https://crates.io/log
     fn try_init(self) -> Result<(), TryInitError> {
         #[cfg(feature = "tracing-log")]
@@ -69,7 +69,7 @@ where
     /// or if a `log` logger has already been set (when the "tracing-log"
     /// feature is enabled).
     ///
-    /// [global default subscriber]: https://docs.rs/tracing/0.1.21/tracing/dispatcher/index.html#setting-the-default-subscriber
+    /// [global default subscriber]: tracing::dispatch#setting-the-default-collector
     /// [`log`]: https://crates.io/log
     fn init(self) {
         self.try_init()
diff --git a/tracing/src/collect.rs b/tracing/src/collect.rs
index 75b1edffe7..3010e726ca 100644
--- a/tracing/src/collect.rs
+++ b/tracing/src/collect.rs
@@ -12,9 +12,9 @@ pub use tracing_core::dispatch::DefaultGuard;
 /// executing, new spans or events are dispatched to the collector that
 /// tagged that span, instead.
 ///
-/// [`Span`]: ../span/struct.Span.html
-/// [`Collect`]: ../collect/trait.Collect.html
-/// [`Event`]: :../event/struct.Event.html
+/// [`Span`]: super::span::Span
+/// [`Collect`]: super::collect::Collect
+/// [`Event`]: tracing_core::Event
 #[cfg(feature = "std")]
 #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
 pub fn with_default(collector: S, f: impl FnOnce() -> T) -> T
@@ -33,8 +33,7 @@ where
 /// Note: Libraries should *NOT* call `set_global_default()`! That will cause conflicts when
 /// executables try to set them later.
 ///
-/// [span]: ../span/index.html
-/// [`Event`]: ../event/struct.Event.html
+/// [span]: super::span
 #[cfg(feature = "alloc")]
 #[cfg_attr(docsrs, doc(cfg(any(feature = "std", feature = "alloc"))))]
 pub fn set_global_default(collector: S) -> Result<(), SetGlobalDefaultError>
@@ -52,9 +51,8 @@ where
 /// executing, new spans or events are dispatched to the collector that
 /// tagged that span, instead.
 ///
-/// [`Span`]: ../span/struct.Span.html
-/// [`Event`]: :../event/struct.Event.html
-/// [`DefaultGuard`]: ../dispatcher/struct.DefaultGuard.html
+/// [`Span`]: super::span::Span
+/// [`Event`]: tracing_core::Event
 #[cfg(feature = "std")]
 #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
 #[must_use = "Dropping the guard unregisters the collector."]
diff --git a/tracing/src/dispatch.rs b/tracing/src/dispatch.rs
index 448dc5b98e..392398439a 100644
--- a/tracing/src/dispatch.rs
+++ b/tracing/src/dispatch.rs
@@ -133,11 +133,7 @@
 //! currently default `Dispatch`. This is used primarily by `tracing`
 //! instrumentation.
 //!
-//! [`Collect`]: struct.Collect.html
-//! [`with_default`]: fn.with_default.html
-//! [`set_global_default`]: fn.set_global_default.html
-//! [`get_default`]: fn.get_default.html
-//! [`Dispatch`]: struct.Dispatch.html
+//! [`Collect`]: tracing_core::Collect
 #[cfg(feature = "std")]
 #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
 pub use tracing_core::dispatch::set_default;
diff --git a/tracing/src/instrument.rs b/tracing/src/instrument.rs
index e3aaf0b4ef..a56b2f9e22 100644
--- a/tracing/src/instrument.rs
+++ b/tracing/src/instrument.rs
@@ -34,7 +34,7 @@ pub trait Instrument: Sized {
     /// # }
     /// ```
     ///
-    /// [entered]: ../struct.Span.html#method.enter
+    /// [entered]: super::Span::enter()
     fn instrument(self, span: Span) -> Instrumented {
         Instrumented { inner: self, span }
     }
@@ -68,8 +68,8 @@ pub trait Instrument: Sized {
     /// # }
     /// ```
     ///
-    /// [current]: ../struct.Span.html#method.current
-    /// [entered]: ../struct.Span.html#method.enter
+    /// [current]: super::Span::current()
+    /// [entered]: super::Span::enter()
     #[inline]
     fn in_current_span(self) -> Instrumented {
         self.instrument(Span::current())
@@ -85,8 +85,8 @@ pub trait WithCollector: Sized {
     ///
     /// The attached collector will be set as the [default] when the returned `Future` is polled.
     ///
-    /// [`Collect`]: ../trait.Collect.html
-    /// [default]: https://docs.rs/tracing/latest/tracing/dispatch/index.html#setting-the-default-collector
+    /// [`Collect`]: super::Collect
+    /// [default]: crate::dispatch#setting-the-default-collector
     fn with_collector(self, collector: S) -> WithDispatch
     where
         S: Into,
@@ -108,7 +108,7 @@ pub trait WithCollector: Sized {
     /// This can be used to propagate the current dispatcher context when
     /// spawning a new future.
     ///
-    /// [default]: https://docs.rs/tracing/latest/tracing/dispatch/index.html#setting-the-default-collector
+    /// [default]: crate::dispatch#setting-the-default-collector
     #[inline]
     fn with_current_collector(self) -> WithDispatch {
         WithDispatch {
diff --git a/tracing/src/level_filters.rs b/tracing/src/level_filters.rs
index df9405b5e4..7a0a60c608 100644
--- a/tracing/src/level_filters.rs
+++ b/tracing/src/level_filters.rs
@@ -49,7 +49,7 @@ pub use tracing_core::{metadata::ParseLevelFilterError, LevelFilter};
 /// `Span` constructors should compare the level against this value to
 /// determine if those spans or events are enabled.
 ///
-/// [module-level documentation]: ../index.html#compile-time-filters
+/// [module-level documentation]: super#compile-time-filters
 pub const STATIC_MAX_LEVEL: LevelFilter = MAX_LEVEL;
 
 cfg_if! {
diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs
index 208568c67e..3dbc85f5a2 100644
--- a/tracing/src/lib.rs
+++ b/tracing/src/lib.rs
@@ -49,7 +49,7 @@
 //! # }
 //!```
 //!
-//! The [`span` module][span]'s documentation provides further details on how to
+//! The [`span` module][mod@span]'s documentation provides further details on how to
 //! use spans.
 //!
 //! 
@@ -416,13 +416,13 @@ //! Specifying a formatted message in this manner does not allocate by default. //! //! [struct initializers]: https://doc.rust-lang.org/book/ch05-01-defining-structs.html#using-the-field-init-shorthand-when-variables-and-fields-have-the-same-name -//! [target]: struct.Metadata.html#method.target -//! [parent span]: span/struct.Attributes.html#method.parent -//! [determined contextually]: span/struct.Attributes.html#method.is_contextual +//! [target]: Metadata::target() +//! [parent span]: span::Attributes::parent() +//! [determined contextually]: span::Attributes::is_contextual() //! [`fmt::Debug`]: https://doc.rust-lang.org/std/fmt/trait.Debug.html //! [`fmt::Display`]: https://doc.rust-lang.org/std/fmt/trait.Display.html //! [fmt]: https://doc.rust-lang.org/std/fmt/#usage -//! [`Empty`]: field/struct.Empty.html +//! [`Empty`]: field::Empty //! //! ### Shorthand Macros //! @@ -436,19 +436,18 @@ //! These are intended both as a shorthand, and for compatibility with the [`log`] //! crate (see the next section). //! -//! [`span!`]: macro.span.html -//! [`event!`]: macro.event.html -//! [`trace!`]: macro.trace.html -//! [`debug!`]: macro.debug.html -//! [`info!`]: macro.info.html -//! [`warn!`]: macro.warn.html -//! [`error!`]: macro.error.html -//! [`trace_span!`]: macro.trace_span.html -//! [`debug_span!`]: macro.debug_span.html -//! [`info_span!`]: macro.info_span.html -//! [`warn_span!`]: macro.warn_span.html -//! [`error_span!`]: macro.error_span.html -//! [`Level`]: struct.Level.html +//! [`span!`]: span! +//! [`event!`]: event! +//! [`trace!`]: trace! +//! [`debug!`]: debug! +//! [`info!`]: info! +//! [`warn!`]: warn! +//! [`error!`]: error! +//! [`trace_span!`]: trace_span! +//! [`debug_span!`]: debug_span! +//! [`info_span!`]: info_span! +//! [`warn_span!`]: warn_span! +//! [`error_span!`]: error_span! //! //! ### For `log` Users //! @@ -849,7 +848,6 @@ //! long as doing so complies with this policy. //! //! [`log`]: https://docs.rs/log/0.4.6/log/ -//! [span]: mod@span //! [spans]: mod@span //! [`Span`]: span::Span //! [`in_scope`]: span::Span::in_scope @@ -861,8 +859,6 @@ //! [`exit`]: collect::Collect::exit //! [`enabled`]: collect::Collect::enabled //! [metadata]: Metadata -//! [`field::display`]: field::display -//! [`field::debug`]: field::debug //! [`set_global_default`]: collect::set_global_default //! [`with_default`]: collect::with_default //! [`tokio-rs/tracing`]: https://github.com/tokio-rs/tracing @@ -873,8 +869,8 @@ //! [`tracing-appender`]: https://crates.io/crates/tracing-appender //! [`env_logger`]: https://crates.io/crates/env_logger //! [`FmtSubscriber`]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/struct.Subscriber.html -//! [static verbosity level]: level_filters/index.html#compile-time-filters -//! [instrument]: https://docs.rs/tracing-attributes/latest/tracing_attributes/attr.instrument.html +//! [static verbosity level]: level_filters#compile-time-filters +//! [instrument]: tracing_attributes::instrument //! [flags]: #crate-feature-flags #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(docsrs, feature(doc_cfg), deny(broken_intra_doc_links))] diff --git a/tracing/src/macros.rs b/tracing/src/macros.rs index fe456e48aa..f69064ed8b 100644 --- a/tracing/src/macros.rs +++ b/tracing/src/macros.rs @@ -3,7 +3,7 @@ /// See [the top-level documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [lib]: index.html#using-the-macros +/// [lib]: crate#using-the-macros /// /// # Examples /// @@ -139,10 +139,10 @@ macro_rules! span { /// See [the top-level documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [lib]: index.html#using-the-macros -/// [attributes]: index.html#configuring-attributes -/// [Fields]: index.html#recording-fields -/// [`span!`]: macro.span.html +/// [lib]: crate#using-the-macros +/// [attributes]: crate#configuring-attributes +/// [Fields]: crate#recording-fields +/// [`span!`]: span! /// /// # Examples /// @@ -220,10 +220,10 @@ macro_rules! trace_span { /// See [the top-level documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [lib]: index.html#using-the-macros -/// [attributes]: index.html#configuring-attributes -/// [Fields]: index.html#recording-fields -/// [`span!`]: macro.span.html +/// [lib]: crate#using-the-macros +/// [attributes]: crate#configuring-attributes +/// [Fields]: crate#recording-fields +/// [`span!`]: span! /// /// # Examples /// @@ -301,10 +301,10 @@ macro_rules! debug_span { /// See [the top-level documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [lib]: index.html#using-the-macros -/// [attributes]: index.html#configuring-attributes -/// [Fields]: index.html#recording-fields -/// [`span!`]: macro.span.html +/// [lib]: crate#using-the-macros +/// [attributes]: crate#configuring-attributes +/// [Fields]: crate#recording-fields +/// [`span!`]: span! /// /// # Examples /// @@ -382,10 +382,10 @@ macro_rules! info_span { /// See [the top-level documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [lib]: index.html#using-the-macros -/// [attributes]: index.html#configuring-attributes -/// [Fields]: index.html#recording-fields -/// [`span!`]: macro.span.html +/// [lib]: crate#using-the-macros +/// [attributes]: crate#configuring-attributes +/// [Fields]: crate#recording-fields +/// [`span!`]: span! /// /// # Examples /// @@ -462,10 +462,10 @@ macro_rules! warn_span { /// See [the top-level documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [lib]: index.html#using-the-macros -/// [attributes]: index.html#configuring-attributes -/// [Fields]: index.html#recording-fields -/// [`span!`]: macro.span.html +/// [lib]: crate#using-the-macros +/// [attributes]: crate#configuring-attributes +/// [Fields]: crate#recording-fields +/// [`span!`]: span! /// /// # Examples /// @@ -544,7 +544,7 @@ macro_rules! error_span { /// See [the top-level documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [lib]: index.html#using-the-macros +/// [lib]: crate#using-the-macros /// /// # Examples /// @@ -806,8 +806,8 @@ macro_rules! event { /// documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [`event!`]: macro.event.html -/// [lib]: index.html#using-the-macros +/// [`event!`]: event! +/// [lib]: crate#using-the-macros /// /// # Examples /// @@ -1006,8 +1006,8 @@ macro_rules! trace { /// documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [`event!`]: macro.event.html -/// [lib]: index.html#using-the-macros +/// [`event!`]: event! +/// [lib]: crate#using-the-macros /// /// # Examples /// @@ -1207,8 +1207,8 @@ macro_rules! debug { /// documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [`event!`]: macro.event.html -/// [lib]: index.html#using-the-macros +/// [`event!`]: event! +/// [lib]: crate#using-the-macros /// /// # Examples /// @@ -1419,8 +1419,8 @@ macro_rules! info { /// documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [`event!`]: macro.event.html -/// [lib]: index.html#using-the-macros +/// [`event!`]: event! +/// [lib]: crate#using-the-macros /// /// # Examples /// @@ -1624,8 +1624,8 @@ macro_rules! warn { /// documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [`event!`]: macro.event.html -/// [lib]: index.html#using-the-macros +/// [`event!`]: event! +/// [lib]: crate#using-the-macros /// /// # Examples /// diff --git a/tracing/src/span.rs b/tracing/src/span.rs index 4c8b851816..bf3311bef8 100644 --- a/tracing/src/span.rs +++ b/tracing/src/span.rs @@ -24,7 +24,7 @@ //! - A string literal providing the span's name. //! - Finally, between zero and 32 arbitrary key/value fields. //! -//! [`target`]: ../struct.Metadata.html#method.target +//! [`target`]: super::Metadata::target() //! //! For example: //! ```rust @@ -293,25 +293,23 @@ //! much time was spent in each individual iteration, we would enter a new span //! on every iteration. //! -//! [fields]: ../field/index.html -//! [Metadata]: ../struct.Metadata.html -//! [`Id`]: struct.Id.html -//! [verbosity level]: ../struct.Level.html -//! [`span!`]: ../macro.span.html -//! [`trace_span!`]: ../macro.trace_span.html -//! [`debug_span!`]: ../macro.debug_span.html -//! [`info_span!`]: ../macro.info_span.html -//! [`warn_span!`]: ../macro.warn_span.html -//! [`error_span!`]: ../macro.error_span.html -//! [`clone_span`]: ../collect/trait.Collect.html#method.clone_span -//! [`drop_span`]: ../collect/trait.Collect.html#method.drop_span -//! [`exit`]: ../collect/trait.Collect.html#tymethod.exit -//! [collector]: ../collect/trait.Collect.html -//! [`Attributes`]: struct.Attributes.html -//! [`enter`]: struct.Span.html#method.enter -//! [`in_scope`]: struct.Span.html#method.in_scope -//! [`follows_from`]: struct.Span.html#method.follows_from -//! [guard]: struct.Entered.html +//! [fields]: super::field +//! [Metadata]: super::Metadata +//! [verbosity level]: super::Level +//! [`span!`]: super::span! +//! [`trace_span!`]: super::trace_span! +//! [`debug_span!`]: super::debug_span! +//! [`info_span!`]: super::info_span! +//! [`warn_span!`]: super::warn_span! +//! [`error_span!`]: super::error_span! +//! [`clone_span`]: super::collect::Collect::clone_span() +//! [`drop_span`]: super::collect::Collect::drop_span() +//! [`exit`]: super::collect::Collect::exit +//! [collector]: super::collect::Collect +//! [`enter`]: Span::enter() +//! [`in_scope`]: Span::in_scope() +//! [`follows_from`]: Span::follows_from() +//! [guard]: Entered //! [parent]: #span-relationships pub use tracing_core::span::{Attributes, Id, Record}; @@ -375,7 +373,7 @@ pub(crate) struct Inner { /// /// This is returned by the [`Span::enter`] function. /// -/// [`Span::enter`]: ../struct.Span.html#method.enter +/// [`Span::enter`]: super::Span::enter() #[derive(Debug)] #[must_use = "once a span has been entered, it should be exited"] pub struct Entered<'a> { @@ -403,9 +401,9 @@ impl Span { /// annotations may be added to it. /// /// [metadata]: ../metadata - /// [collector]: ../collect/trait.Collect.html - /// [field values]: ../field/struct.ValueSet.html - /// [`follows_from`]: ../struct.Span.html#method.follows_from + /// [collector]: super::collect::Collect + /// [field values]: super::field::ValueSet + /// [`follows_from`]: super::Span::follows_from() pub fn new(meta: &'static Metadata<'static>, values: &field::ValueSet<'_>) -> Span { dispatch::get_default(|dispatch| Self::new_with(meta, values, dispatch)) } @@ -428,8 +426,8 @@ impl Span { /// annotations may be added to it. /// /// [metadata]: ../metadata - /// [field values]: ../field/struct.ValueSet.html - /// [`follows_from`]: ../struct.Span.html#method.follows_from + /// [field values]: super::field::ValueSet + /// [`follows_from`]: super::Span::follows_from() pub fn new_root(meta: &'static Metadata<'static>, values: &field::ValueSet<'_>) -> Span { dispatch::get_default(|dispatch| Self::new_root_with(meta, values, dispatch)) } @@ -452,8 +450,8 @@ impl Span { /// annotations may be added to it. /// /// [metadata]: ../metadata - /// [field values]: ../field/struct.ValueSet.html - /// [`follows_from`]: ../struct.Span.html#method.follows_from + /// [field values]: super::field::ValueSet + /// [`follows_from`]: super::Span::follows_from() pub fn child_of( parent: impl Into>, meta: &'static Metadata<'static>, @@ -517,7 +515,7 @@ impl Span { /// that the thread from which this function is called is not currently /// inside a span, the returned span will be disabled. /// - /// [considered by the `Collector`]: ../collector/trait.Collector.html#method.current + /// [considered by the `Collector`]: super::collect::Collect::current_span() pub fn current() -> Span { dispatch::get_default(|dispatch| { if let Some((id, meta)) = dispatch.current_span().into_inner() { @@ -560,8 +558,8 @@ impl Span { /// Enters this span, returning a guard that will exit the span when dropped. /// /// If this span is enabled by the current collector, then this function will - /// call [`Collector::enter`] with the span's [`Id`], and dropping the guard - /// will call [`Collector::exit`]. If the span is disabled, this does + /// call [`Collect::enter`] with the span's [`Id`], and dropping the guard + /// will call [`Collect::exit`]. If the span is disabled, this does /// nothing. /// ///
@@ -625,7 +623,7 @@ impl Span { /// // This is okay! The span has already been exited before we reach /// // the await point. /// some_other_async_function(some_value).await; - /// + /// /// // ... /// } /// ``` @@ -634,7 +632,7 @@ impl Span { /// attaching a span to a future (async function or block). This will /// enter the span _every_ time the future is polled, and exit it whenever /// the future yields. - /// + /// /// `Instrument` can be used with an async block inside an async function: /// ```ignore /// # use tracing::info_span; @@ -681,20 +679,19 @@ impl Span { /// # async fn some_other_async_function() {} /// #[tracing::instrument(level = "info")] /// async fn my_async_function() { - /// + /// /// // This is correct! If we yield here, the span will be exited, /// // and re-entered when we resume. /// some_other_async_function().await; /// /// // ... - /// + /// /// } /// ``` /// /// [syntax]: https://rust-lang.github.io/async-book/01_getting_started/04_async_await_primer.html - /// [`Span::in_scope`]: #method.in_scope - /// [instrument]: https://docs.rs/tracing/latest/tracing/trait.Instrument.html - /// [attr]: ../../attr.instrument.html + /// [instrument]: crate::Instrument + /// [attr]: macro@crate::instrument /// /// # Examples /// @@ -753,9 +750,9 @@ impl Span { /// info!("i'm outside the span!") /// ``` /// - /// [`Collector::enter`]: ../collector/trait.Collector.html#method.enter - /// [`Collector::exit`]: ../collector/trait.Collector.html#method.exit - /// [`Id`]: ../struct.Id.html + /// [`Collect::enter`]: super::collect::Collect::enter() + /// [`Collect::exit`]: super::collect::Collect::exit() + /// [`Id`]: super::Id pub fn enter(&self) -> Entered<'_> { if let Some(ref inner) = self.inner.as_ref() { inner.collector.enter(&inner.id); @@ -904,8 +901,8 @@ impl Span { /// span.record("parting", &"you will be remembered"); /// ``` /// - /// [`field::Empty`]: ../field/struct.Empty.html - /// [`Metadata`]: ../struct.Metadata.html + /// [`field::Empty`]: super::field::Empty + /// [`Metadata`]: super::Metadata pub fn record(&self, field: &Q, value: &V) -> &Self where Q: field::AsField, @@ -950,7 +947,7 @@ impl Span { /// /// See also [`is_none`]. /// - /// [`is_none`]: #method.is_none + /// [`is_none`]: Span::is_none() #[inline] pub fn is_disabled(&self) -> bool { self.inner.is_none() @@ -964,8 +961,7 @@ impl Span { /// rather than constructed by `Span::none`, this method will return /// `false`, while `is_disabled` will return `true`. /// - /// [`Span::none`]: #method.none - /// [`is_disabled`]: #method.is_disabled + /// [`is_disabled`]: Span::is_disabled() #[inline] pub fn is_none(&self) -> bool { self.is_disabled() && self.meta.is_none() diff --git a/tracing/src/subscribe.rs b/tracing/src/subscribe.rs index a48fa09b84..f92d811c48 100644 --- a/tracing/src/subscribe.rs +++ b/tracing/src/subscribe.rs @@ -12,8 +12,8 @@ pub use tracing_core::dispatch::DefaultGuard; /// executing, new spans or events are dispatched to the subscriber that /// tagged that span, instead. /// -/// [`Span`]: ../span/struct.Span.html -/// [`Collect`]: ../collect/trait.Collect.html +/// [`Span`]: super::span::Span +/// [`Collect`]: super::collect::Collect // /// [`Event`]: :../event/struct.Event.html #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] @@ -33,9 +33,9 @@ where /// Note: Libraries should *NOT* call `set_global_default()`! That will cause conflicts when /// executables try to set them later. /// -/// [span]: ../span/index.html -/// [`Collect`]: ../collect/trait.Collect.html -/// [`Event`]: ../event/struct.Event.html +/// [span]: super::span +/// [`Collect`]: super::collect::Collect +/// [`Event`]: super::event::Event #[cfg(feature = "alloc")] #[cfg_attr(docsrs, doc(cfg(any(feature = "std", feature = "alloc"))))] pub fn set_global_default(collector: S) -> Result<(), SetGlobalDefaultError> @@ -53,10 +53,10 @@ where /// executing, new spans or events are dispatched to the collector that /// tagged that span, instead. /// -/// [`Span`]: ../span/struct.Span.html -/// [`Collect`]: ../collect/trait.Collect.html +/// [`Span`]: super::span::Span +/// [`Collect`]: super::collect::Collect /// [`Event`]: :../event/struct.Event.html -/// [`DefaultGuard`]: ../dispatch/struct.DefaultGuard.html +/// [`DefaultGuard`]: super::dispatch::DefaultGuard #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] #[must_use = "Dropping the guard unregisters the collector."]