From 438b013c0174435b5081e69780630b34deaf1cf7 Mon Sep 17 00:00:00 2001 From: Benjamin Herr <24142+ben0x539@users.noreply.github.com> Date: Thu, 14 Apr 2022 12:12:43 -0700 Subject: [PATCH] docs: use intra-doc links instead of relative file paths (#2068) ## Motivation #940, I guess. I kept running into the odd broken link in the docs and eventually realized it's because a lot of stuff is reexported in parent modules and so the file path based relative links couldn't possibly work in all contexts. Looks like master already underwent this treatment but I suspect this is easier than backporting. ## Solution Intra-doc links seem pretty good. I started with ``` find -name \*.rs -exec sed -i -e ' s@\(//. \[[^]]*\]:\s\+\)[:"]\?\.\./\w\+\.\(\w\+\)\.html@\1super::\2@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\.\./\(\w\+\)/\w\+\.\(\w\+\)\.html@\1super::\2::\3@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\.\./\.\./\w\+\.\(\w\+\)\.html@\1super::super::\2@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\.\./\.\./\(\w\+\)/\w\+\.\(\w\+\)\.html@\1super::super::\2::\3@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\.\./\(\w\+\)/index\.html@\1super::\2@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\.\./index\.html@\1super@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\.\./\(\w\+\)/\?$@\1super::\2@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\./\w\+\.\(\w\+\)\.html@\1self::\2@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\./\(\w\+\)/\w\+\.\(\w\+\)\.html@\1self::\2::\3@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\./\(\w\+\)/index\.html@\1self::\2@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\./index\.html@\1self@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\./\(\w\+\)/\?$@\1self::\2@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\w\+\.\(\w\+\)\.html@\1self::\2@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\(\w\+\)/\w\+\.\(\w\+\)\.html@\1self::\2::\3@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\(\w\+\)/index\.html@\1self::\2@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?index\.html@\1self@; s@\(//. \[[^]]*\]:\s\+\)[:"]\?\(\w\+\)/\?$@\1self::\2@; s@\(//. \[[^]]*\]:\s\+[A-Za-z_0-9:]\+\)#method\.\(\w\+\)@\1::\2@; ' {} + ``` and then removed redundant `self::`s when I realized you don't actually need a `::` in the links, and fixed stuff up by hand as I ran into errors from ``` x='--cfg docsrs --cfg tracing_unstable'; RUSTFLAGS=$x RUSTDOCFLAGS=$x cargo doc --all-features ``` I hope that's roughly how the docs are supposed to work. I understand this is a relatively big unsolicited change in that it touches a whole lot of files (definitely went further than I originally intended), I'm happy to revise or split or reduce scope of this PR as desired. --- tracing-appender/src/lib.rs | 12 +-- tracing-appender/src/non_blocking.rs | 14 +-- tracing-appender/src/rolling.rs | 22 ++--- tracing-attributes/src/lib.rs | 2 +- tracing-core/src/callsite.rs | 21 ++-- tracing-core/src/dispatcher.rs | 108 ++++++++++----------- tracing-core/src/event.rs | 8 +- tracing-core/src/field.rs | 52 +++++----- tracing-core/src/lib.rs | 32 +++--- tracing-core/src/metadata.rs | 16 +-- tracing-core/src/span.rs | 14 +-- tracing-core/src/subscriber.rs | 78 +++++++-------- tracing-error/src/layer.rs | 2 +- tracing-error/src/lib.rs | 14 +-- tracing-flame/src/lib.rs | 8 +- tracing-futures/src/lib.rs | 4 +- tracing-log/src/lib.rs | 18 ++-- tracing-log/src/log_tracer.rs | 2 +- tracing-log/src/trace_logger.rs | 18 ++-- tracing-subscriber/src/field/delimited.rs | 2 +- tracing-subscriber/src/field/display.rs | 2 +- tracing-subscriber/src/filter/env/mod.rs | 2 +- tracing-subscriber/src/fmt/fmt_layer.rs | 22 ++--- tracing-subscriber/src/fmt/format/json.rs | 10 +- tracing-subscriber/src/fmt/format/mod.rs | 26 ++--- tracing-subscriber/src/fmt/mod.rs | 36 ++++--- tracing-subscriber/src/fmt/time/mod.rs | 2 +- tracing-subscriber/src/fmt/writer.rs | 8 +- tracing-subscriber/src/layer/context.rs | 14 +-- tracing-subscriber/src/layer/mod.rs | 2 +- tracing-subscriber/src/lib.rs | 4 +- tracing-subscriber/src/registry/mod.rs | 16 +-- tracing-subscriber/src/registry/sharded.rs | 12 +-- tracing-subscriber/src/reload.rs | 4 +- tracing/src/dispatcher.rs | 10 +- tracing/src/level_filters.rs | 2 +- tracing/src/lib.rs | 36 +++---- tracing/src/macros.rs | 64 ++++++------ tracing/src/span.rs | 37 +++---- tracing/src/subscriber.rs | 20 ++-- 40 files changed, 386 insertions(+), 390 deletions(-) diff --git a/tracing-appender/src/lib.rs b/tracing-appender/src/lib.rs index 1774bb5dbb..1dfe0ab52b 100644 --- a/tracing-appender/src/lib.rs +++ b/tracing-appender/src/lib.rs @@ -10,7 +10,7 @@ //! *Compiler support: [requires `rustc` 1.53+][msrv]* //! //! [msrv]: #supported-rust-versions -//! [file_appender]: ./rolling/struct.RollingFileAppender.html +//! [file_appender]: rolling::RollingFileAppender //! [tracing]: https://docs.rs/tracing/ //! //! # Usage @@ -88,12 +88,12 @@ //! //! The [`non_blocking` module][non_blocking]'s documentation provides more detail on how to use `non_blocking`. //! -//! [non_blocking]: ./non_blocking/index.html +//! [non_blocking]: mod@non_blocking //! [write]: https://doc.rust-lang.org/std/io/trait.Write.html -//! [guard]: ./non_blocking/struct.WorkerGuard.html -//! [rolling]: ./rolling/index.html +//! [guard]: non_blocking::WorkerGuard +//! [rolling]: rolling //! [make_writer]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/trait.MakeWriter.html -//! [rolling_struct]: ./rolling/struct.RollingFileAppender.html +//! [rolling_struct]: rolling::RollingFileAppender //! [fmt_subscriber]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/struct.Subscriber.html //! //! ## Non-Blocking Rolling File Appender @@ -166,7 +166,7 @@ pub(crate) mod sync; /// /// See the [`non_blocking` module's docs][non_blocking]'s for more details. /// -/// [non_blocking]: ./non_blocking/index.html +/// [non_blocking]: mod@non_blocking /// /// # Examples /// diff --git a/tracing-appender/src/non_blocking.rs b/tracing-appender/src/non_blocking.rs index 45e7b667e9..efbcd4c7c8 100644 --- a/tracing-appender/src/non_blocking.rs +++ b/tracing-appender/src/non_blocking.rs @@ -19,7 +19,7 @@ //! tracing_appender::non_blocking(std::io::stdout()) //! # } //! ``` -//! [builder]: ./struct.NonBlockingBuilder.html#method.default +//! [builder]: NonBlockingBuilder::default //! //!
This function returns a tuple of `NonBlocking` and `WorkerGuard`. //! `NonBlocking` implements [`MakeWriter`] which integrates with `tracing_subscriber`. @@ -33,7 +33,7 @@ //! //! See [`WorkerGuard`][worker_guard] for examples of using the guard. //! -//! [worker_guard]: ./struct.WorkerGuard.html +//! [worker_guard]: WorkerGuard //! //! # Examples //! @@ -65,7 +65,7 @@ use tracing_subscriber::fmt::MakeWriter; /// backpressure will be exerted on senders, causing them to block their /// respective threads until there is available capacity. /// -/// [non-blocking]: ./struct.NonBlocking.html +/// [non-blocking]: NonBlocking /// Recommended to be a power of 2. pub const DEFAULT_BUFFERED_LINES_LIMIT: usize = 128_000; @@ -78,7 +78,7 @@ pub const DEFAULT_BUFFERED_LINES_LIMIT: usize = 128_000; /// terminates abruptly (such as through an uncaught `panic` or a `std::process::exit`), some spans /// or events may not be written. /// -/// [`NonBlocking`]: ./struct.NonBlocking.html +/// [`NonBlocking`]: NonBlocking /// Since spans/events and events recorded near a crash are often necessary for diagnosing the failure, /// `WorkerGuard` provides a mechanism to ensure that _all_ buffered logs are flushed to their output. /// `WorkerGuard` should be assigned in the `main` function or whatever the entrypoint of the program is. @@ -145,8 +145,8 @@ impl NonBlocking { /// The returned `NonBlocking` writer will have the [default configuration][default] values. /// Other configurations can be specified using the [builder] interface. /// - /// [default]: ./struct.NonBlockingBuilder.html#method.default - /// [builder]: ./struct.NonBlockingBuilder.html + /// [default]: NonBlockingBuilder::default + /// [builder]: NonBlockingBuilder pub fn new(writer: T) -> (NonBlocking, WorkerGuard) { NonBlockingBuilder::default().finish(writer) } @@ -183,7 +183,7 @@ impl NonBlocking { /// A builder for [`NonBlocking`][non-blocking]. /// -/// [non-blocking]: ./struct.NonBlocking.html +/// [non-blocking]: NonBlocking #[derive(Debug)] pub struct NonBlockingBuilder { buffered_lines_limit: usize, diff --git a/tracing-appender/src/rolling.rs b/tracing-appender/src/rolling.rs index 501456af8c..107cc96905 100644 --- a/tracing-appender/src/rolling.rs +++ b/tracing-appender/src/rolling.rs @@ -1,6 +1,6 @@ //! A rolling file appender. //! -//! Creates a new log file at a fixed frequency as defined by [`Rotation`](struct.Rotation.html). +//! Creates a new log file at a fixed frequency as defined by [`Rotation`][self::Rotation]. //! Logs will be written to this file for the duration of the period and will automatically roll over //! to the newly created log file once the time period has elapsed. //! @@ -17,10 +17,10 @@ //! will be created daily //! - [`Rotation::never()`][never()]: This will result in log file located at `some_directory/log_file_name` //! -//! [minutely]: fn.minutely.html -//! [hourly]: fn.hourly.html -//! [daily]: fn.daily.html -//! [never]: fn.never.html +//! [minutely]: minutely +//! [hourly]: hourly +//! [daily]: daily +//! [never]: never //! //! # Examples //! @@ -114,7 +114,7 @@ impl RollingFileAppender { /// Creates a new `RollingFileAppender`. /// /// A `RollingFileAppender` will have a fixed rotation whose frequency is - /// defined by [`Rotation`](struct.Rotation.html). The `directory` and + /// defined by [`Rotation`][self::Rotation]. The `directory` and /// `file_name_prefix` arguments determine the location and file name's _prefix_ /// of the log file. `RollingFileAppender` will automatically append the current date /// and hour (UTC format) to the file name. @@ -126,10 +126,10 @@ impl RollingFileAppender { /// - [`Rotation::daily()`][daily], /// - [`Rotation::never()`][never()] /// - /// [minutely]: fn.minutely.html - /// [hourly]: fn.hourly.html - /// [daily]: fn.daily.html - /// [never]: fn.never.html + /// [minutely]: minutely + /// [hourly]: hourly + /// [daily]: daily + /// [never]: never /// /// # Examples /// ```rust @@ -284,7 +284,7 @@ pub fn hourly( /// a non-blocking, daily file appender. /// /// A `RollingFileAppender` has a fixed rotation whose frequency is -/// defined by [`Rotation`](struct.Rotation.html). The `directory` and +/// defined by [`Rotation`][self::Rotation]. The `directory` and /// `file_name_prefix` arguments determine the location and file name's _prefix_ /// of the log file. `RollingFileAppender` automatically appends the current date in UTC. /// diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs index 8875de0bfd..65d65d748f 100644 --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -36,7 +36,7 @@ //! //! [`tracing`]: https://crates.io/crates/tracing //! [span]: https://docs.rs/tracing/latest/tracing/span/index.html -//! [instrument]: attr.instrument.html +//! [instrument]: macro@self::instrument //! //! ## Supported Rust Versions //! diff --git a/tracing-core/src/callsite.rs b/tracing-core/src/callsite.rs index d0acae41de..38ff14a2f0 100644 --- a/tracing-core/src/callsite.rs +++ b/tracing-core/src/callsite.rs @@ -77,12 +77,12 @@ impl Registry { pub trait Callsite: Sync { /// Sets the [`Interest`] for this callsite. /// - /// [`Interest`]: ../subscriber/struct.Interest.html + /// [`Interest`]: super::subscriber::Interest fn set_interest(&self, interest: Interest); /// Returns the [metadata] associated with the callsite. /// - /// [metadata]: ../metadata/struct.Metadata.html + /// [metadata]: super::metadata::Metadata fn metadata(&self) -> &Metadata<'_>; } @@ -90,7 +90,7 @@ pub trait Callsite: Sync { /// /// Two `Identifier`s are equal if they both refer to the same callsite. /// -/// [`Callsite`]: ../callsite/trait.Callsite.html +/// [`Callsite`]: super::callsite::Callsite #[derive(Clone)] pub struct Identifier( /// **Warning**: The fields on this type are currently `pub` because it must @@ -98,9 +98,8 @@ pub struct Identifier( /// fn`s are available on stable Rust, this will no longer be necessary. /// Thus, these fields are *not* considered stable public API, and they may /// change warning. Do not rely on any fields on `Identifier`. When - /// constructing new `Identifier`s, use the `identify_callsite!` macro or - /// the `Callsite::id` function instead. - // TODO: When `Callsite::id` is a const fn, this need no longer be `pub`. + /// constructing new `Identifier`s, use the `identify_callsite!` macro + /// instead. #[doc(hidden)] pub &'static dyn Callsite, ); @@ -119,11 +118,11 @@ pub struct Identifier( /// implementation at runtime, then it **must** call this function after that /// value changes, in order for the change to be reflected. /// -/// [`max_level_hint`]: ../subscriber/trait.Subscriber.html#method.max_level_hint -/// [`Callsite`]: ../callsite/trait.Callsite.html -/// [`enabled`]: ../subscriber/trait.Subscriber.html#tymethod.enabled -/// [`Interest::sometimes()`]: ../subscriber/struct.Interest.html#method.sometimes -/// [`Subscriber`]: ../subscriber/trait.Subscriber.html +/// [`max_level_hint`]: super::subscriber::Subscriber::max_level_hint +/// [`Callsite`]: super::callsite::Callsite +/// [`enabled`]: super::subscriber::Subscriber#tymethod.enabled +/// [`Interest::sometimes()`]: super::subscriber::Interest::sometimes +/// [`Subscriber`]: super::subscriber::Subscriber pub fn rebuild_interest_cache() { let mut registry = REGISTRY.lock().unwrap(); registry.rebuild_interest(); diff --git a/tracing-core/src/dispatcher.rs b/tracing-core/src/dispatcher.rs index 204c261e41..1d0c22f9a2 100644 --- a/tracing-core/src/dispatcher.rs +++ b/tracing-core/src/dispatcher.rs @@ -123,11 +123,11 @@ //! currently default `Dispatch`. This is used primarily by `tracing` //! instrumentation. //! -//! [`Subscriber`]: struct.Subscriber.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 +//! [`Subscriber`]: Subscriber +//! [`with_default`]: with_default +//! [`set_global_default`]: set_global_default +//! [`get_default`]: get_default +//! [`Dispatch`]: Dispatch use crate::{ callsite, span, subscriber::{self, NoSubscriber, Subscriber}, @@ -151,7 +151,7 @@ use crate::stdlib::{ /// `Dispatch` trace data to a [`Subscriber`]. /// -/// [`Subscriber`]: trait.Subscriber.html +/// [`Subscriber`]: Subscriber #[derive(Clone)] pub struct Dispatch { subscriber: Arc, @@ -213,10 +213,10 @@ pub struct DefaultGuard(Option); /// set_global_default instead. /// /// -/// [span]: ../span/index.html -/// [`Subscriber`]: ../subscriber/trait.Subscriber.html -/// [`Event`]: ../event/struct.Event.html -/// [`set_global_default`]: ../fn.set_global_default.html +/// [span]: super::span +/// [`Subscriber`]: super::subscriber::Subscriber +/// [`Event`]: super::event::Event +/// [`set_global_default`]: super::set_global_default #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] pub fn with_default(dispatcher: &Dispatch, f: impl FnOnce() -> T) -> T { @@ -237,7 +237,7 @@ pub fn with_default(dispatcher: &Dispatch, f: impl FnOnce() -> T) -> T { /// set_global_default instead. /// /// -/// [`set_global_default`]: ../fn.set_global_default.html +/// [`set_global_default`]: super::set_global_default #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] #[must_use = "Dropping the guard unregisters the dispatcher."] @@ -261,9 +261,9 @@ pub fn set_default(dispatcher: &Dispatch) -> DefaultGuard { /// executables that depend on the library try to set the default later. /// /// -/// [span]: ../span/index.html -/// [`Subscriber`]: ../subscriber/trait.Subscriber.html -/// [`Event`]: ../event/struct.Event.html +/// [span]: super::span +/// [`Subscriber`]: super::subscriber::Subscriber +/// [`Event`]: super::event::Event pub fn set_global_default(dispatcher: Dispatch) -> Result<(), SetGlobalDefaultError> { // if `compare_exchange` returns Result::Ok(_), then `new` has been set and // `current`—now the prior value—has been returned in the `Ok()` branch. @@ -319,7 +319,7 @@ impl error::Error for SetGlobalDefaultError {} /// called while inside of another `get_default`, that closure will be provided /// with `Dispatch::none` rather than the previously set dispatcher. /// -/// [dispatcher]: ../dispatcher/struct.Dispatch.html +/// [dispatcher]: super::dispatcher::Dispatch #[cfg(feature = "std")] pub fn get_default(mut f: F) -> T where @@ -342,7 +342,7 @@ where /// called while inside of another `get_default`, that closure will be provided /// with `Dispatch::none` rather than the previously set dispatcher. /// -/// [dispatcher]: ../dispatcher/struct.Dispatch.html +/// [dispatcher]: super::dispatcher::Dispatch #[cfg(feature = "std")] #[doc(hidden)] #[inline(never)] @@ -357,7 +357,7 @@ pub fn get_current(f: impl FnOnce(&Dispatch) -> T) -> Option { /// Executes a closure with a reference to the current [dispatcher]. /// -/// [dispatcher]: ../dispatcher/struct.Dispatch.html +/// [dispatcher]: super::dispatcher::Dispatch #[cfg(not(feature = "std"))] #[doc(hidden)] pub fn get_current(f: impl FnOnce(&Dispatch) -> T) -> Option { @@ -367,7 +367,7 @@ pub fn get_current(f: impl FnOnce(&Dispatch) -> T) -> Option { /// Executes a closure with a reference to the current [dispatcher]. /// -/// [dispatcher]: ../dispatcher/struct.Dispatch.html +/// [dispatcher]: super::dispatcher::Dispatch #[cfg(not(feature = "std"))] pub fn get_default(mut f: F) -> T where @@ -406,7 +406,7 @@ impl Dispatch { /// Returns a `Dispatch` that forwards to the given [`Subscriber`]. /// - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html + /// [`Subscriber`]: super::subscriber::Subscriber pub fn new(subscriber: S) -> Self where S: Subscriber + Send + Sync + 'static, @@ -428,8 +428,8 @@ impl Dispatch { /// This calls the [`register_callsite`] function on the [`Subscriber`] /// that this `Dispatch` forwards to. /// - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`register_callsite`]: ../subscriber/trait.Subscriber.html#method.register_callsite + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`register_callsite`]: super::subscriber::Subscriber::register_callsite #[inline] pub fn register_callsite(&self, metadata: &'static Metadata<'static>) -> subscriber::Interest { self.subscriber.register_callsite(metadata) @@ -442,9 +442,9 @@ impl Dispatch { /// This calls the [`max_level_hint`] function on the [`Subscriber`] /// that this `Dispatch` forwards to. /// - /// [level]: ../struct.Level.html - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`register_callsite`]: ../subscriber/trait.Subscriber.html#method.max_level_hint + /// [level]: super::Level + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`register_callsite`]: super::subscriber::Subscriber::max_level_hint // TODO(eliza): consider making this a public API? #[inline] pub(crate) fn max_level_hint(&self) -> Option { @@ -457,9 +457,9 @@ impl Dispatch { /// This calls the [`new_span`] function on the [`Subscriber`] that this /// `Dispatch` forwards to. /// - /// [ID]: ../span/struct.Id.html - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`new_span`]: ../subscriber/trait.Subscriber.html#method.new_span + /// [ID]: super::span::Id + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`new_span`]: super::subscriber::Subscriber::new_span #[inline] pub fn new_span(&self, span: &span::Attributes<'_>) -> span::Id { self.subscriber.new_span(span) @@ -470,8 +470,8 @@ impl Dispatch { /// This calls the [`record`] function on the [`Subscriber`] that this /// `Dispatch` forwards to. /// - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`record`]: ../subscriber/trait.Subscriber.html#method.record + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`record`]: super::subscriber::Subscriber::record #[inline] pub fn record(&self, span: &span::Id, values: &span::Record<'_>) { self.subscriber.record(span, values) @@ -483,8 +483,8 @@ impl Dispatch { /// This calls the [`record_follows_from`] function on the [`Subscriber`] /// that this `Dispatch` forwards to. /// - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`record_follows_from`]: ../subscriber/trait.Subscriber.html#method.record_follows_from + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`record_follows_from`]: super::subscriber::Subscriber::record_follows_from #[inline] pub fn record_follows_from(&self, span: &span::Id, follows: &span::Id) { self.subscriber.record_follows_from(span, follows) @@ -496,9 +496,9 @@ impl Dispatch { /// This calls the [`enabled`] function on the [`Subscriber`] that this /// `Dispatch` forwards to. /// - /// [metadata]: ../metadata/struct.Metadata.html - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`enabled`]: ../subscriber/trait.Subscriber.html#method.enabled + /// [metadata]: super::metadata::Metadata + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`enabled`]: super::subscriber::Subscriber::enabled #[inline] pub fn enabled(&self, metadata: &Metadata<'_>) -> bool { self.subscriber.enabled(metadata) @@ -509,9 +509,9 @@ impl Dispatch { /// This calls the [`event`] function on the [`Subscriber`] that this /// `Dispatch` forwards to. /// - /// [`Event`]: ../event/struct.Event.html - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`event`]: ../subscriber/trait.Subscriber.html#method.event + /// [`Event`]: super::event::Event + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`event`]: super::subscriber::Subscriber::event #[inline] pub fn event(&self, event: &Event<'_>) { self.subscriber.event(event) @@ -522,8 +522,8 @@ impl Dispatch { /// This calls the [`enter`] function on the [`Subscriber`] that this /// `Dispatch` forwards to. /// - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`enter`]: ../subscriber/trait.Subscriber.html#method.enter + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`enter`]: super::subscriber::Subscriber::enter pub fn enter(&self, span: &span::Id) { self.subscriber.enter(span); } @@ -533,8 +533,8 @@ impl Dispatch { /// This calls the [`exit`] function on the [`Subscriber`] that this /// `Dispatch` forwards to. /// - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`exit`]: ../subscriber/trait.Subscriber.html#method.exit + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`exit`]: super::subscriber::Subscriber::exit pub fn exit(&self, span: &span::Id) { self.subscriber.exit(span); } @@ -549,10 +549,10 @@ impl Dispatch { /// This calls the [`clone_span`] function on the `Subscriber` that this /// `Dispatch` forwards to. /// - /// [span ID]: ../span/struct.Id.html - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`clone_span`]: ../subscriber/trait.Subscriber.html#method.clone_span - /// [`new_span`]: ../subscriber/trait.Subscriber.html#method.new_span + /// [span ID]: super::span::Id + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`clone_span`]: super::subscriber::Subscriber::clone_span + /// [`new_span`]: super::subscriber::Subscriber::new_span #[inline] pub fn clone_span(&self, id: &span::Id) -> span::Id { self.subscriber.clone_span(id) @@ -575,10 +575,10 @@ impl Dispatch { /// instead of this method. /// /// - /// [span ID]: ../span/struct.Id.html - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`drop_span`]: ../subscriber/trait.Subscriber.html#method.drop_span - /// [`new_span`]: ../subscriber/trait.Subscriber.html#method.new_span + /// [span ID]: super::span::Id + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`drop_span`]: super::subscriber::Subscriber::drop_span + /// [`new_span`]: super::subscriber::Subscriber::new_span /// [`try_close`]: #method.try_close #[inline] #[deprecated(since = "0.1.2", note = "use `Dispatch::try_close` instead")] @@ -598,10 +598,10 @@ impl Dispatch { /// This calls the [`try_close`] function on the [`Subscriber`] that this /// `Dispatch` forwards to. /// - /// [span ID]: ../span/struct.Id.html - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [`try_close`]: ../subscriber/trait.Subscriber.html#method.try_close - /// [`new_span`]: ../subscriber/trait.Subscriber.html#method.new_span + /// [span ID]: super::span::Id + /// [`Subscriber`]: super::subscriber::Subscriber + /// [`try_close`]: super::subscriber::Subscriber::try_close + /// [`new_span`]: super::subscriber::Subscriber::new_span pub fn try_close(&self, id: span::Id) -> bool { self.subscriber.try_close(id) } @@ -611,7 +611,7 @@ impl Dispatch { /// This calls the [`current`] function on the `Subscriber` that this /// `Dispatch` forwards to. /// - /// [`current`]: ../subscriber/trait.Subscriber.html#method.current + /// [`current`]: super::subscriber::Subscriber::current_span #[inline] pub fn current_span(&self) -> span::Current { self.subscriber.current_span() diff --git a/tracing-core/src/event.rs b/tracing-core/src/event.rs index 999f2ced7f..6e25437629 100644 --- a/tracing-core/src/event.rs +++ b/tracing-core/src/event.rs @@ -17,8 +17,8 @@ use crate::{field, Metadata}; /// associated with an event should be in the event's fields rather than in /// the textual message, as the fields are more structured. /// -/// [span]: ../span -/// [fields]: ../field +/// [span]: super::span +/// [fields]: super::field #[derive(Debug)] pub struct Event<'a> { fields: &'a field::ValueSet<'a>, @@ -81,7 +81,7 @@ impl<'a> Event<'a> { /// Visits all the fields on this `Event` with the specified [visitor]. /// - /// [visitor]: ../field/trait.Visit.html + /// [visitor]: super::field::Visit #[inline] pub fn record(&self, visitor: &mut dyn field::Visit) { self.fields.record(visitor); @@ -94,7 +94,7 @@ impl<'a> Event<'a> { /// Returns [metadata] describing this `Event`. /// - /// [metadata]: ../struct.Metadata.html + /// [metadata]: super::Metadata pub fn metadata(&self) -> &'static Metadata<'static> { self.metadata } diff --git a/tracing-core/src/field.rs b/tracing-core/src/field.rs index 000f2822e7..eeff65ddf6 100644 --- a/tracing-core/src/field.rs +++ b/tracing-core/src/field.rs @@ -100,17 +100,17 @@ //! [`record_value`]: Visit::record_value //! [`record_debug`]: Visit::record_debug //! -//! [`Value`]: trait.Value.html -//! [span]: ../span/ -//! [`Event`]: ../event/struct.Event.html -//! [`Metadata`]: ../metadata/struct.Metadata.html -//! [`Attributes`]: ../span/struct.Attributes.html -//! [`Record`]: ../span/struct.Record.html -//! [`new_span`]: ../subscriber/trait.Subscriber.html#method.new_span -//! [`record`]: ../subscriber/trait.Subscriber.html#method.record -//! [`event`]: ../subscriber/trait.Subscriber.html#method.event -//! [`Value::record`]: trait.Value.html#method.record -//! [`Visit`]: trait.Visit.html +//! [`Value`]: Value +//! [span]: super::span +//! [`Event`]: super::event::Event +//! [`Metadata`]: super::metadata::Metadata +//! [`Attributes`]: super::span::Attributes +//! [`Record`]: super::span::Record +//! [`new_span`]: super::subscriber::Subscriber::new_span +//! [`record`]: super::subscriber::Subscriber::record +//! [`event`]: super::subscriber::Subscriber::event +//! [`Value::record`]: Value::record +//! [`Visit`]: Visit use crate::callsite; use crate::stdlib::{ borrow::Borrow, @@ -249,13 +249,13 @@ pub struct Iter { /// std::error::Error trait. /// /// -/// [`Value`]: trait.Value.html -/// [recorded]: trait.Value.html#method.record -/// [`Subscriber`]: ../subscriber/trait.Subscriber.html -/// [records an `Event`]: ../subscriber/trait.Subscriber.html#method.event -/// [set of `Value`s added to a `Span`]: ../subscriber/trait.Subscriber.html#method.record -/// [`Event`]: ../event/struct.Event.html -/// [`ValueSet`]: struct.ValueSet.html +/// [`Value`]: Value +/// [recorded]: Value::record +/// [`Subscriber`]: super::subscriber::Subscriber +/// [records an `Event`]: super::subscriber::Subscriber::event +/// [set of `Value`s added to a `Span`]: super::subscriber::Subscriber::record +/// [`Event`]: super::event::Event +/// [`ValueSet`]: ValueSet pub trait Visit { /// Visits an arbitrary type implementing the [`valuable`] crate's `Valuable` trait. /// @@ -314,7 +314,7 @@ pub trait Visit { /// the [visitor] passed to their `record` method in order to indicate how /// their data should be recorded. /// -/// [visitor]: trait.Visit.html +/// [visitor]: Visit pub trait Value: crate::sealed::Sealed { /// Visits this value with the given `Visitor`. fn record(&self, key: &Field, visitor: &mut dyn Visit); @@ -713,8 +713,8 @@ impl Field { /// Returns an [`Identifier`] that uniquely identifies the [`Callsite`] /// which defines this field. /// - /// [`Identifier`]: ../callsite/struct.Identifier.html - /// [`Callsite`]: ../callsite/trait.Callsite.html + /// [`Identifier`]: super::callsite::Identifier + /// [`Callsite`]: super::callsite::Callsite #[inline] pub fn callsite(&self) -> callsite::Identifier { self.fields.callsite() @@ -779,15 +779,15 @@ impl FieldSet { /// Returns an [`Identifier`] that uniquely identifies the [`Callsite`] /// which defines this set of fields.. /// - /// [`Identifier`]: ../callsite/struct.Identifier.html - /// [`Callsite`]: ../callsite/trait.Callsite.html + /// [`Identifier`]: super::callsite::Identifier + /// [`Callsite`]: super::callsite::Callsite pub(crate) fn callsite(&self) -> callsite::Identifier { callsite::Identifier(self.callsite.0) } /// Returns the [`Field`] named `name`, or `None` if no such field exists. /// - /// [`Field`]: ../struct.Field.html + /// [`Field`]: super::Field pub fn field(&self, name: &Q) -> Option where Q: Borrow, @@ -905,8 +905,8 @@ impl<'a> ValueSet<'a> { /// Returns an [`Identifier`] that uniquely identifies the [`Callsite`] /// defining the fields this `ValueSet` refers to. /// - /// [`Identifier`]: ../callsite/struct.Identifier.html - /// [`Callsite`]: ../callsite/trait.Callsite.html + /// [`Identifier`]: super::callsite::Identifier + /// [`Callsite`]: super::callsite::Callsite #[inline] pub fn callsite(&self) -> callsite::Identifier { self.fields.callsite() diff --git a/tracing-core/src/lib.rs b/tracing-core/src/lib.rs index 912eae8820..7424a6cb3f 100644 --- a/tracing-core/src/lib.rs +++ b/tracing-core/src/lib.rs @@ -104,16 +104,16 @@ //! long as doing so complies with this policy. //! //! -//! [`span::Id`]: span/struct.Id.html -//! [`Event`]: event/struct.Event.html -//! [`Subscriber`]: subscriber/trait.Subscriber.html -//! [`Metadata`]: metadata/struct.Metadata.html -//! [`Callsite`]: callsite/trait.Callsite.html -//! [`Field`]: field/struct.Field.html -//! [`FieldSet`]: field/struct.FieldSet.html -//! [`Value`]: field/trait.Value.html -//! [`ValueSet`]: field/struct.ValueSet.html -//! [`Dispatch`]: dispatcher/struct.Dispatch.html +//! [`span::Id`]: span::Id +//! [`Event`]: event::Event +//! [`Subscriber`]: subscriber::Subscriber +//! [`Metadata`]: metadata::Metadata +//! [`Callsite`]: callsite::Callsite +//! [`Field`]: field::Field +//! [`FieldSet`]: field::FieldSet +//! [`Value`]: field::Value +//! [`ValueSet`]: field::ValueSet +//! [`Dispatch`]: dispatcher::Dispatch //! [`tokio-rs/tracing`]: https://github.com/tokio-rs/tracing //! [`tracing`]: https://crates.io/crates/tracing #![doc(html_root_url = "https://docs.rs/tracing-core/0.1.22")] @@ -150,8 +150,7 @@ extern crate alloc; /// Statically constructs an [`Identifier`] for the provided [`Callsite`]. /// -/// This may be used in contexts, such as static initializers, where the -/// [`Callsite::id`] function is not currently usable. +/// This may be used in contexts such as static initializers. /// /// For example: /// ```rust @@ -175,9 +174,8 @@ extern crate alloc; /// # } /// ``` /// -/// [`Identifier`]: callsite/struct.Identifier.html -/// [`Callsite`]: callsite/trait.Callsite.html -/// [`Callsite::id`]: callsite/trait.Callsite.html#method.id +/// [`Identifier`]: callsite::Identifier +/// [`Callsite`]: callsite::Callsite #[macro_export] macro_rules! identify_callsite { ($callsite:expr) => { @@ -214,8 +212,8 @@ macro_rules! identify_callsite { /// # } /// ``` /// -/// [metadata]: metadata/struct.Metadata.html -/// [`Metadata::new`]: metadata/struct.Metadata.html#method.new +/// [metadata]: metadata::Metadata +/// [`Metadata::new`]: metadata::Metadata::new #[macro_export] macro_rules! metadata { ( diff --git a/tracing-core/src/metadata.rs b/tracing-core/src/metadata.rs index b6ecaf583e..b6046e4d9a 100644 --- a/tracing-core/src/metadata.rs +++ b/tracing-core/src/metadata.rs @@ -45,8 +45,8 @@ use crate::stdlib::{ /// correspond to the same callsite. /// /// -/// [span]: ../span/index.html -/// [event]: ../event/index.html +/// [span]: super::span +/// [event]: super::event /// [name]: #method.name /// [target]: #method.target /// [fields]: #method.fields @@ -54,9 +54,9 @@ use crate::stdlib::{ /// [file name]: #method.file /// [line number]: #method.line /// [module path]: #method.module -/// [`Subscriber`]: ../subscriber/trait.Subscriber.html -/// [`id`]: struct.Metadata.html#method.id -/// [callsite identifier]: ../callsite/struct.Identifier.html +/// [`Subscriber`]: super::subscriber::Subscriber +/// [`id`]: Metadata::id +/// [callsite identifier]: super::callsite::Identifier pub struct Metadata<'a> { /// The name of the span described by this metadata. name: &'static str, @@ -604,7 +604,7 @@ impl LevelFilter { /// Returns the most verbose [`Level`] that this filter accepts, or `None` /// if it is [`OFF`]. /// - /// [`Level`]: ../struct.Level.html + /// [`Level`]: super::Level /// [`OFF`]: #associatedconstant.OFF pub const fn into_level(self) -> Option { self.0 @@ -638,8 +638,8 @@ impl LevelFilter { /// *disabled*, but **should not** be used for determining if something is /// *enabled*. /// - /// [`Level`]: ../struct.Level.html - /// [`Subscriber`]: ../../trait.Subscriber.html + /// [`Level`]: super::Level + /// [`Subscriber`]: super::Subscriber #[inline(always)] pub fn current() -> Self { match MAX_LEVEL.load(Ordering::Relaxed) { diff --git a/tracing-core/src/span.rs b/tracing-core/src/span.rs index adf4bfefa4..c600af4d99 100644 --- a/tracing-core/src/span.rs +++ b/tracing-core/src/span.rs @@ -10,8 +10,8 @@ use crate::{field, Metadata}; /// the [`new_span`] trait method. See the documentation for that method for /// more information on span ID generation. /// -/// [`Subscriber`]: ../subscriber/trait.Subscriber.html -/// [`new_span`]: ../subscriber/trait.Subscriber.html#method.new_span +/// [`Subscriber`]: super::subscriber::Subscriber +/// [`new_span`]: super::subscriber::Subscriber::new_span #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct Id(NonZeroU64); @@ -38,9 +38,9 @@ pub struct Record<'a> { /// - "none", indicating that the current context is known to not be in a span, /// - "some", with the current span's [`Id`] and [`Metadata`]. /// -/// [the `Subscriber` considers]: ../subscriber/trait.Subscriber.html#method.current_span -/// [`Id`]: struct.Id.html -/// [`Metadata`]: ../metadata/struct.Metadata.html +/// [the `Subscriber` considers]: super::subscriber::Subscriber::current_span +/// [`Id`]: Id +/// [`Metadata`]: super::metadata::Metadata #[derive(Debug)] pub struct Current { inner: CurrentInner, @@ -179,7 +179,7 @@ impl<'a> Attributes<'a> { /// Records all the fields in this set of `Attributes` with the provided /// [Visitor]. /// - /// [visitor]: ../field/trait.Visit.html + /// [visitor]: super::field::Visit pub fn record(&self, visitor: &mut dyn field::Visit) { self.values.record(visitor) } @@ -221,7 +221,7 @@ impl<'a> Record<'a> { /// Records all the fields in this `Record` with the provided [Visitor]. /// - /// [visitor]: ../field/trait.Visit.html + /// [visitor]: super::field::Visit pub fn record(&self, visitor: &mut dyn field::Visit) { self.values.record(visitor) } diff --git a/tracing-core/src/subscriber.rs b/tracing-core/src/subscriber.rs index 11695e5382..d138fcb5b4 100644 --- a/tracing-core/src/subscriber.rs +++ b/tracing-core/src/subscriber.rs @@ -64,13 +64,13 @@ use crate::stdlib::{ /// Subscribers which store per-span data or which need to track span closures /// should override these functions together. /// -/// [ID]: ../span/struct.Id.html -/// [`new_span`]: trait.Subscriber.html#method.new_span -/// [`register_callsite`]: trait.Subscriber.html#method.register_callsite -/// [`Interest`]: struct.Interest.html -/// [`enabled`]: trait.Subscriber.html#method.enabled -/// [`clone_span`]: trait.Subscriber.html#method.clone_span -/// [`try_close`]: trait.Subscriber.html#method.try_close +/// [ID]: super::span::Id +/// [`new_span`]: Subscriber::new_span +/// [`register_callsite`]: Subscriber::register_callsite +/// [`Interest`]: Interest +/// [`enabled`]: Subscriber::enabled +/// [`clone_span`]: Subscriber::clone_span +/// [`try_close`]: Subscriber::try_close pub trait Subscriber: 'static { // === Span registry methods ============================================== @@ -137,10 +137,10 @@ pub trait Subscriber: 'static { /// another subscriber expressed interest in it. /// /// [filter]: #method.enabled - /// [metadata]: ../metadata/struct.Metadata.html - /// [`Interest`]: struct.Interest.html + /// [metadata]: super::metadata::Metadata + /// [`Interest`]: Interest /// [`enabled`]: #method.enabled - /// [`rebuild_interest_cache`]: ../callsite/fn.rebuild_interest_cache.html + /// [`rebuild_interest_cache`]: super::callsite::rebuild_interest_cache fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest { if self.enabled(metadata) { Interest::always() @@ -165,9 +165,9 @@ pub trait Subscriber: 'static { /// [`Interest::sometimes`]. In that case, this function will be called every /// time that span or event occurs. /// - /// [metadata]: ../metadata/struct.Metadata.html - /// [interested]: struct.Interest.html - /// [`Interest::sometimes`]: struct.Interest.html#method.sometimes + /// [metadata]: super::metadata::Metadata + /// [interested]: Interest + /// [`Interest::sometimes`]: Interest::sometimes /// [`register_callsite`]: #method.register_callsite fn enabled(&self, metadata: &Metadata<'_>) -> bool; @@ -191,9 +191,9 @@ pub trait Subscriber: 'static { /// [`rebuild_interest_cache`][rebuild] is called after the value of the max /// level changes. /// - /// [level]: ../struct.Level.html - /// [`Interest`]: struct.Interest.html - /// [rebuild]: ../callsite/fn.rebuild_interest_cache.html + /// [level]: super::Level + /// [`Interest`]: Interest + /// [rebuild]: super::callsite::rebuild_interest_cache fn max_level_hint(&self) -> Option { None } @@ -218,10 +218,10 @@ pub trait Subscriber: 'static { /// scheme it sees fit. Any guarantees about uniqueness, ordering, or ID /// reuse are left up to the subscriber implementation to determine. /// - /// [span ID]: ../span/struct.Id.html - /// [`Attributes`]: ../span/struct.Attributes.html - /// [visitor]: ../field/trait.Visit.html - /// [`record` method]: ../span/struct.Attributes.html#method.record + /// [span ID]: super::span::Id + /// [`Attributes`]: super::span::Attributes + /// [visitor]: super::field::Visit + /// [`record` method]: super::span::Attributes::record fn new_span(&self, span: &span::Attributes<'_>) -> span::Id; // === Notification methods =============================================== @@ -259,9 +259,9 @@ pub trait Subscriber: 'static { /// span.record("baz", &"a string"); /// ``` /// - /// [visitor]: ../field/trait.Visit.html - /// [`record`]: ../span/struct.Attributes.html#method.record - /// [`record` method]: ../span/struct.Record.html#method.record + /// [visitor]: super::field::Visit + /// [`record`]: super::span::Attributes::record + /// [`record` method]: super::span::Record::record fn record(&self, span: &span::Id, values: &span::Record<'_>); /// Adds an indication that `span` follows from the span with the id @@ -298,10 +298,10 @@ pub trait Subscriber: 'static { /// event. The subscriber may pass a [visitor] to the `Event`'s /// [`record` method] to record these values. /// - /// [`Event`]: ../event/struct.Event.html - /// [visitor]: ../field/trait.Visit.html - /// [`record` method]: ../event/struct.Event.html#method.record - /// [`dispatch` method]: ../event/struct.Event.html#method.dispatch + /// [`Event`]: super::event::Event + /// [visitor]: super::field::Visit + /// [`record` method]: super::event::Event::record + /// [`dispatch` method]: super::event::Event::dispatch fn event(&self, event: &Event<'_>); /// Records that a span has been entered. @@ -311,7 +311,7 @@ pub trait Subscriber: 'static { /// [span ID] of the entered span, and should update any internal state /// tracking the current span accordingly. /// - /// [span ID]: ../span/struct.Id.html + /// [span ID]: super::span::Id fn enter(&self, span: &span::Id); /// Records that a span has been exited. @@ -323,7 +323,7 @@ pub trait Subscriber: 'static { /// /// Exiting a span does not imply that the span will not be re-entered. /// - /// [span ID]: ../span/struct.Id.html + /// [span ID]: super::span::Id fn exit(&self, span: &span::Id); /// Notifies the subscriber that a [span ID] has been cloned. @@ -344,8 +344,8 @@ pub trait Subscriber: 'static { /// kind this can be used as a hook to "clone" the pointer, depending on /// what that means for the specified pointer. /// - /// [span ID]: ../span/struct.Id.html - /// [`try_close`]: trait.Subscriber.html#method.try_close + /// [span ID]: super::span::Id + /// [`try_close`]: Subscriber::try_close fn clone_span(&self, id: &span::Id) -> span::Id { id.clone() } @@ -358,7 +358,7 @@ pub trait Subscriber: 'static { /// /// The default implementation of this function does nothing. /// - /// [`try_close`]: trait.Subscriber.html#method.try_close + /// [`try_close`]: Subscriber::try_close #[deprecated(since = "0.1.2", note = "use `Subscriber::try_close` instead")] fn drop_span(&self, _id: span::Id) {} @@ -395,9 +395,9 @@ pub trait Subscriber: 'static { /// inside of a `try_close` function may cause a double panic, if the span /// was dropped due to a thread unwinding. /// - /// [span ID]: ../span/struct.Id.html - /// [`clone_span`]: trait.Subscriber.html#method.clone_span - /// [`drop_span`]: trait.Subscriber.html#method.drop_span + /// [span ID]: super::span::Id + /// [`clone_span`]: Subscriber::clone_span + /// [`drop_span`]: Subscriber::drop_span fn try_close(&self, id: span::Id) -> bool { #[allow(deprecated)] self.drop_span(id); @@ -415,8 +415,8 @@ pub trait Subscriber: 'static { /// does **not** track what span is current. If the subscriber does not /// implement a current span, it should not override this method. /// - /// [`Current::new`]: ../span/struct.Current.html#tymethod.new - /// [`Current::none`]: ../span/struct.Current.html#tymethod.none + /// [`Current::new`]: super::span::Current#tymethod.new + /// [`Current::none`]: super::span::Current#tymethod.none fn current_span(&self) -> span::Current { span::Current::unknown() } @@ -482,8 +482,8 @@ impl dyn Subscriber { /// `Subscriber`s return an `Interest` from their [`register_callsite`] methods /// in order to determine whether that span should be enabled or disabled. /// -/// [`Subscriber`]: ../trait.Subscriber.html -/// [`register_callsite`]: ../trait.Subscriber.html#method.register_callsite +/// [`Subscriber`]: super::Subscriber +/// [`register_callsite`]: super::Subscriber::register_callsite #[derive(Clone, Debug)] pub struct Interest(InterestKind); diff --git a/tracing-error/src/layer.rs b/tracing-error/src/layer.rs index 14c019258a..79a74b60eb 100644 --- a/tracing-error/src/layer.rs +++ b/tracing-error/src/layer.rs @@ -16,7 +16,7 @@ use tracing_subscriber::{ /// provided, the [default format] is used instead. /// /// [`Layer`]: https://docs.rs/tracing-subscriber/0.3/tracing_subscriber/layer/trait.Layer.html -/// [`SpanTrace`]: ../struct.SpanTrace.html +/// [`SpanTrace`]: super::SpanTrace /// [field formatter]: https://docs.rs/tracing-subscriber/0.3/tracing_subscriber/fmt/trait.FormatFields.html /// [default format]: https://docs.rs/tracing-subscriber/0.3/tracing_subscriber/fmt/format/struct.DefaultFields.html pub struct ErrorLayer { diff --git a/tracing-error/src/lib.rs b/tracing-error/src/lib.rs index a54543c333..04b0c86906 100644 --- a/tracing-error/src/lib.rs +++ b/tracing-error/src/lib.rs @@ -157,13 +157,13 @@ //! } //! ``` //! -//! [`SpanTrace`]: struct.SpanTrace.html -//! [`ErrorLayer`]: struct.ErrorLayer.html -//! [`TracedError`]: struct.TracedError.html -//! [`InstrumentResult`]: trait.InstrumentResult.html -//! [`InstrumentError`]: trait.InstrumentError.html -//! [`ExtractSpanTrace`]: trait.ExtractSpanTrace.html -//! [`in_current_span()`]: trait.InstrumentResult.html#tymethod.in_current_span +//! [`SpanTrace`]: SpanTrace +//! [`ErrorLayer`]: ErrorLayer +//! [`TracedError`]: TracedError +//! [`InstrumentResult`]: InstrumentResult +//! [`InstrumentError`]: InstrumentError +//! [`ExtractSpanTrace`]: ExtractSpanTrace +//! [`in_current_span()`]: InstrumentResult#tymethod.in_current_span //! [span]: https://docs.rs/tracing/latest/tracing/span/index.html //! [events]: https://docs.rs/tracing/latest/tracing/struct.Event.html //! [`Subscriber`]: https://docs.rs/tracing/latest/tracing/trait.Subscriber.html diff --git a/tracing-flame/src/lib.rs b/tracing-flame/src/lib.rs index ac827e2ad8..eaad2de9c8 100644 --- a/tracing-flame/src/lib.rs +++ b/tracing-flame/src/lib.rs @@ -91,8 +91,8 @@ //! //! [`tracing`]: https://docs.rs/tracing //! [`inferno`]: https://docs.rs/inferno -//! [`FlameLayer`]: struct.FlameLayer.html -//! [`FlushGuard`]: struct.FlushGuard.html +//! [`FlameLayer`]: FlameLayer +//! [`FlushGuard`]: FlushGuard //! [`inferno-flamegraph`]: https://docs.rs/inferno/0.9.5/inferno/index.html#producing-a-flame-graph //! //! ## Supported Rust Versions @@ -211,8 +211,8 @@ thread_local! { /// will flush the writer when it is dropped. If necessary, it can also be used to manually /// flush the writer. /// -/// [`flush_on_drop`]: struct.FlameLayer.html#method.flush_on_drop -/// [`FlushGuard`]: struct.FlushGuard.html +/// [`flush_on_drop`]: FlameLayer::flush_on_drop +/// [`FlushGuard`]: FlushGuard #[derive(Debug)] pub struct FlameLayer { out: Arc>, diff --git a/tracing-futures/src/lib.rs b/tracing-futures/src/lib.rs index 083208962f..6c12075c9a 100644 --- a/tracing-futures/src/lib.rs +++ b/tracing-futures/src/lib.rs @@ -55,8 +55,8 @@ //! [`tracing`]: https://crates.io/crates/tracing //! [span]: https://docs.rs/tracing/latest/tracing/span/index.html //! [`Subscriber`]: https://docs.rs/tracing/latest/tracing/subscriber/index.html -//! [`Instrument`]: trait.Instrument.html -//! [`WithSubscriber`]: trait.WithSubscriber.html +//! [`Instrument`]: Instrument +//! [`WithSubscriber`]: WithSubscriber //! [`futures`]: https://crates.io/crates/futures //! //! ## Supported Rust Versions diff --git a/tracing-log/src/lib.rs b/tracing-log/src/lib.rs index 8a2b1a17c1..ba95e2e7e3 100644 --- a/tracing-log/src/lib.rs +++ b/tracing-log/src/lib.rs @@ -91,13 +91,13 @@ //! supported compiler version is not considered a semver breaking change as //! long as doing so complies with this policy. //! -//! [`init`]: struct.LogTracer.html#method.init -//! [`init_with_filter`]: struct.LogTracer.html#method.init_with_filter -//! [`AsTrace`]: trait.AsTrace.html -//! [`AsLog`]: trait.AsLog.html -//! [`LogTracer`]: struct.LogTracer.html -//! [`TraceLogger`]: struct.TraceLogger.html -//! [`env_logger`]: env_logger/index.html +//! [`init`]: LogTracer::init +//! [`init_with_filter`]: LogTracer::init_with_filter +//! [`AsTrace`]: AsTrace +//! [`AsLog`]: AsLog +//! [`LogTracer`]: LogTracer +//! [`TraceLogger`]: TraceLogger +//! [`env_logger`]: env_logger //! [`tracing`]: https://crates.io/crates/tracing //! [`log`]: https://crates.io/crates/log //! [`env_logger` crate]: https://crates.io/crates/env-logger @@ -487,8 +487,8 @@ impl AsLog for tracing_core::LevelFilter { /// to allow accessing its complete metadata in a consistent way, /// regardless of the source of its source. /// -/// [`normalized_metadata`]: trait.NormalizeEvent.html#normalized_metadata -/// [`AsTrace`]: trait.AsTrace.html +/// [`normalized_metadata`]: NormalizeEvent#normalized_metadata +/// [`AsTrace`]: AsTrace /// [`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 diff --git a/tracing-log/src/log_tracer.rs b/tracing-log/src/log_tracer.rs index 91b1d4caba..1f24e4ace8 100644 --- a/tracing-log/src/log_tracer.rs +++ b/tracing-log/src/log_tracer.rs @@ -208,7 +208,7 @@ impl log::Log for LogTracer { impl Builder { /// Returns a new `Builder` to construct a [`LogTracer`]. /// - /// [`LogTracer`]: struct.LogTracer.html + /// [`LogTracer`]: LogTracer pub fn new() -> Self { Self::default() } diff --git a/tracing-log/src/trace_logger.rs b/tracing-log/src/trace_logger.rs index 86ef6b431e..9aaf47449e 100644 --- a/tracing-log/src/trace_logger.rs +++ b/tracing-log/src/trace_logger.rs @@ -10,7 +10,7 @@ //! //! [`log`]: https://docs.rs/log/0.4.8/log/index.html //! [`Subscriber`]: https://docs.rs/tracing/0.1.7/tracing/subscriber/trait.Subscriber.html -//! [`TraceLogger`]: struct.TraceLogger.html +//! [`TraceLogger`]: TraceLogger //! [`log::Record`]: https://docs.rs/log/0.4.8/log/struct.Record.html //! [flags]: https://docs.rs/tracing/latest/tracing/#crate-feature-flags #![deprecated( @@ -53,7 +53,7 @@ thread_local! { } /// Configures and constructs a [`TraceLogger`]. /// -/// [`TraceLogger`]: struct.TraceLogger.html +/// [`TraceLogger`]: TraceLogger #[derive(Debug)] pub struct Builder { log_span_closes: bool, @@ -95,7 +95,7 @@ impl Builder { /// Configures whether or not the [`TraceLogger`] being constructed will log /// when a span closes. /// - /// [`TraceLogger`]: struct.TraceLogger.html + /// [`TraceLogger`]: TraceLogger pub fn with_span_closes(self, log_span_closes: bool) -> Self { Self { log_span_closes, @@ -106,7 +106,7 @@ impl Builder { /// Configures whether or not the [`TraceLogger`] being constructed will /// include the fields of parent spans when formatting events. /// - /// [`TraceLogger`]: struct.TraceLogger.html + /// [`TraceLogger`]: TraceLogger pub fn with_parent_fields(self, parent_fields: bool) -> Self { Self { parent_fields, @@ -120,7 +120,7 @@ impl Builder { /// If this is set to false, fields from the current span will still be /// recorded as context, but the actual entry will not create a log record. /// - /// [`TraceLogger`]: struct.TraceLogger.html + /// [`TraceLogger`]: TraceLogger pub fn with_span_entry(self, log_enters: bool) -> Self { Self { log_enters, ..self } } @@ -128,7 +128,7 @@ impl Builder { /// Configures whether or not the [`TraceLogger`] being constructed will log /// when a span is exited. /// - /// [`TraceLogger`]: struct.TraceLogger.html + /// [`TraceLogger`]: TraceLogger pub fn with_span_exits(self, log_exits: bool) -> Self { Self { log_exits, ..self } } @@ -136,7 +136,7 @@ impl Builder { /// Configures whether or not the [`TraceLogger`] being constructed will /// include span IDs when formatting log output. /// - /// [`TraceLogger`]: struct.TraceLogger.html + /// [`TraceLogger`]: TraceLogger pub fn with_ids(self, log_ids: bool) -> Self { Self { log_ids, ..self } } @@ -144,14 +144,14 @@ impl Builder { /// Configures whether or not the [`TraceLogger`] being constructed will /// include the names of parent spans as context when formatting events. /// - /// [`TraceLogger`]: struct.TraceLogger.html + /// [`TraceLogger`]: TraceLogger pub fn with_parent_names(self, log_parent: bool) -> Self { Self { log_parent, ..self } } /// Complete the builder, returning a configured [`TraceLogger`]. /// - /// [`TraceLogger`]: struct.TraceLogger.html + /// [`TraceLogger`]: TraceLogger pub fn finish(self) -> TraceLogger { TraceLogger::from_builder(self) } diff --git a/tracing-subscriber/src/field/delimited.rs b/tracing-subscriber/src/field/delimited.rs index 8c78c4b203..513a096284 100644 --- a/tracing-subscriber/src/field/delimited.rs +++ b/tracing-subscriber/src/field/delimited.rs @@ -41,7 +41,7 @@ impl Delimited { /// Returns a new [`MakeVisitor`] implementation that wraps `inner` so that /// it will format each visited field separated by the provided `delimiter`. /// - /// [`MakeVisitor`]: ../trait.MakeVisitor.html + /// [`MakeVisitor`]: super::MakeVisitor pub fn new(delimiter: D, inner: V) -> Self { Self { delimiter, inner } } diff --git a/tracing-subscriber/src/field/display.rs b/tracing-subscriber/src/field/display.rs index e0bbc55ed2..78a039ce17 100644 --- a/tracing-subscriber/src/field/display.rs +++ b/tracing-subscriber/src/field/display.rs @@ -18,7 +18,7 @@ impl Messages { /// Returns a new [`MakeVisitor`] implementation that will wrap `inner` so /// that any strings named `message` are formatted using `fmt::Display`. /// - /// [`MakeVisitor`]: ../trait.MakeVisitor.html + /// [`MakeVisitor`]: super::MakeVisitor pub fn new(inner: V) -> Self { Messages(inner) } diff --git a/tracing-subscriber/src/filter/env/mod.rs b/tracing-subscriber/src/filter/env/mod.rs index 50270c50d7..939161cba6 100644 --- a/tracing-subscriber/src/filter/env/mod.rs +++ b/tracing-subscriber/src/filter/env/mod.rs @@ -415,7 +415,7 @@ impl EnvFilter { /// and events as a previous filter, but sets a different level for those /// spans and events, the previous directive is overwritten. /// - /// [`LevelFilter`]: ../filter/struct.LevelFilter.html + /// [`LevelFilter`]: super::LevelFilter /// [`Level`]: https://docs.rs/tracing-core/latest/tracing_core/struct.Level.html /// /// # Examples diff --git a/tracing-subscriber/src/fmt/fmt_layer.rs b/tracing-subscriber/src/fmt/fmt_layer.rs index 19eccf5fd5..54af4d0e47 100644 --- a/tracing-subscriber/src/fmt/fmt_layer.rs +++ b/tracing-subscriber/src/fmt/fmt_layer.rs @@ -56,7 +56,7 @@ use tracing_core::{ /// # tracing::subscriber::set_global_default(subscriber).unwrap(); /// ``` /// -/// [`Layer`]: ../layer/trait.Layer.html +/// [`Layer`]: super::layer::Layer #[cfg_attr(docsrs, doc(cfg(all(feature = "fmt", feature = "std"))))] #[derive(Debug)] pub struct Layer< @@ -74,7 +74,7 @@ pub struct Layer< } impl Layer { - /// Returns a new [`Layer`](struct.Layer.html) with the default configuration. + /// Returns a new [`Layer`][self::Layer] with the default configuration. pub fn new() -> Self { Self::default() } @@ -256,7 +256,7 @@ impl Layer { /// ``` /// [capturing]: /// https://doc.rust-lang.org/book/ch11-02-running-tests.html#showing-function-output - /// [`TestWriter`]: writer/struct.TestWriter.html + /// [`TestWriter`]: super::writer::TestWriter pub fn with_test_writer(self) -> Layer { Layer { fmt_fields: self.fmt_fields, @@ -466,7 +466,7 @@ where } } - /// Sets the layer being built to use a [less verbose formatter](../fmt/format/struct.Compact.html). + /// Sets the layer being built to use a [less verbose formatter][super::format::Compact]. pub fn compact(self) -> Layer, W> where N: for<'writer> FormatFields<'writer> + 'static, @@ -495,7 +495,7 @@ where } } - /// Sets the layer being built to use a [JSON formatter](../fmt/format/struct.Json.html). + /// Sets the layer being built to use a [JSON formatter][super::format::Json]. /// /// The full format includes fields from all entered spans. /// @@ -531,7 +531,7 @@ where impl Layer, W> { /// Sets the JSON layer being built to flatten event metadata. /// - /// See [`format::Json`](../fmt/format/struct.Json.html) + /// See [`format::Json`][super::format::Json] pub fn flatten_event( self, flatten_event: bool, @@ -546,7 +546,7 @@ impl Layer, W> { /// Sets whether or not the formatter will include the current span in /// formatted events. /// - /// See [`format::Json`](../fmt/format/struct.Json.html) + /// See [`format::Json`][super::format::Json] pub fn with_current_span( self, display_current_span: bool, @@ -561,7 +561,7 @@ impl Layer, W> { /// Sets whether or not the formatter will include a list (from root to leaf) /// of all currently entered spans in formatted events. /// - /// See [`format::Json`](../fmt/format/struct.Json.html) + /// See [`format::Json`][super::format::Json] pub fn with_span_list( self, display_span_list: bool, @@ -660,7 +660,7 @@ where /// formatters are in use, each can store its own formatted representation /// without conflicting. /// -/// [extensions]: ../registry/struct.Extensions.html +/// [extensions]: crate::registry::Extensions #[derive(Default)] pub struct FormattedFields { _format_fields: PhantomData, @@ -984,7 +984,7 @@ where /// If this returns `None`, then no span exists for that ID (either it has /// closed or the ID is invalid). /// - /// [stored data]: ../registry/struct.SpanRef.html + /// [stored data]: crate::registry::SpanRef #[inline] pub fn span(&self, id: &Id) -> Option> where @@ -1007,7 +1007,7 @@ where /// /// If this returns `None`, then we are not currently within a span. /// - /// [stored data]: ../registry/struct.SpanRef.html + /// [stored data]: crate::registry::SpanRef #[inline] pub fn lookup_current(&self) -> Option> where diff --git a/tracing-subscriber/src/fmt/format/json.rs b/tracing-subscriber/src/fmt/format/json.rs index 20292833d7..ab22be7205 100644 --- a/tracing-subscriber/src/fmt/format/json.rs +++ b/tracing-subscriber/src/fmt/format/json.rs @@ -341,7 +341,7 @@ impl Default for Json { /// The JSON [`FormatFields`] implementation. /// -/// [`FormatFields`]: trait.FormatFields.html +/// [`FormatFields`]: FormatFields #[derive(Debug)] pub struct JsonFields { // reserve the ability to add fields to this without causing a breaking @@ -352,7 +352,7 @@ pub struct JsonFields { impl JsonFields { /// Returns a new JSON [`FormatFields`] implementation. /// - /// [`FormatFields`]: trait.FormatFields.html + /// [`FormatFields`]: FormatFields pub fn new() -> Self { Self { _private: () } } @@ -421,9 +421,9 @@ impl<'a> FormatFields<'a> for JsonFields { /// The [visitor] produced by [`JsonFields`]'s [`MakeVisitor`] implementation. /// -/// [visitor]: ../../field/trait.Visit.html -/// [`JsonFields`]: struct.JsonFields.html -/// [`MakeVisitor`]: ../../field/trait.MakeVisitor.html +/// [visitor]: crate::field::Visit +/// [`JsonFields`]: JsonFields +/// [`MakeVisitor`]: crate::field::MakeVisitor pub struct JsonVisitor<'a> { values: BTreeMap<&'a str, serde_json::Value>, writer: &'a mut dyn Write, diff --git a/tracing-subscriber/src/fmt/format/mod.rs b/tracing-subscriber/src/fmt/format/mod.rs index c9b9295b92..9e9212cdfa 100644 --- a/tracing-subscriber/src/fmt/format/mod.rs +++ b/tracing-subscriber/src/fmt/format/mod.rs @@ -227,8 +227,8 @@ where /// time a span or event with fields is recorded, the subscriber will format /// those fields with its associated `FormatFields` implementation. /// -/// [set of fields]: ../field/trait.RecordFields.html -/// [`FmtSubscriber`]: ../fmt/struct.Subscriber.html +/// [set of fields]: crate::field::RecordFields +/// [`FmtSubscriber`]: super::Subscriber pub trait FormatFields<'writer> { /// Format the provided `fields` to the provided [`Writer`], returning a result. fn format_fields(&self, writer: Writer<'writer>, fields: R) -> fmt::Result; @@ -281,7 +281,7 @@ pub fn json() -> Format { /// Returns a [`FormatFields`] implementation that formats fields using the /// provided function or closure. /// -/// [`FormatFields`]: trait.FormatFields.html +/// [`FormatFields`]: FormatFields pub fn debug_fn(f: F) -> FieldFn where F: Fn(&mut Writer<'_>, &Field, &dyn fmt::Debug) -> fmt::Result + Clone, @@ -313,14 +313,14 @@ pub struct Writer<'writer> { /// A [`FormatFields`] implementation that formats fields by calling a function /// or closure. /// -/// [`FormatFields`]: trait.FormatFields.html +/// [`FormatFields`]: FormatFields #[derive(Debug, Clone)] pub struct FieldFn(F); /// The [visitor] produced by [`FieldFn`]'s [`MakeVisitor`] implementation. /// -/// [visitor]: ../../field/trait.Visit.html -/// [`FieldFn`]: struct.FieldFn.html -/// [`MakeVisitor`]: ../../field/trait.MakeVisitor.html +/// [visitor]: super::super::field::Visit +/// [`FieldFn`]: FieldFn +/// [`MakeVisitor`]: super::super::field::MakeVisitor pub struct FieldFnVisitor<'a, F> { f: F, writer: Writer<'a>, @@ -855,7 +855,7 @@ impl Format { /// ```ignore,json /// {"timestamp":"Feb 20 11:28:15.096","level":"INFO","target":"mycrate", "message":"some message", "key": "value"} /// ``` - /// See [`Json`](../format/struct.Json.html). + /// See [`Json`][super::format::Json]. #[cfg(feature = "json")] #[cfg_attr(docsrs, doc(cfg(feature = "json")))] pub fn flatten_event(mut self, flatten_event: bool) -> Format { @@ -866,7 +866,7 @@ impl Format { /// Sets whether or not the formatter will include the current span in /// formatted events. /// - /// See [`format::Json`](../fmt/format/struct.Json.html) + /// See [`format::Json`][Json] #[cfg(feature = "json")] #[cfg_attr(docsrs, doc(cfg(feature = "json")))] pub fn with_current_span(mut self, display_current_span: bool) -> Format { @@ -877,7 +877,7 @@ impl Format { /// Sets whether or not the formatter will include a list (from root to /// leaf) of all currently entered spans in formatted events. /// - /// See [`format::Json`](../fmt/format/struct.Json.html) + /// See [`format::Json`][Json] #[cfg(feature = "json")] #[cfg_attr(docsrs, doc(cfg(feature = "json")))] pub fn with_span_list(mut self, display_span_list: bool) -> Format { @@ -1157,7 +1157,7 @@ where /// The default [`FormatFields`] implementation. /// -/// [`FormatFields`]: trait.FormatFields.html +/// [`FormatFields`]: FormatFields #[derive(Debug)] pub struct DefaultFields { // reserve the ability to add fields to this without causing a breaking @@ -1179,7 +1179,7 @@ pub struct DefaultVisitor<'a> { impl DefaultFields { /// Returns a new default [`FormatFields`] implementation. /// - /// [`FormatFields`]: trait.FormatFields.html + /// [`FormatFields`]: FormatFields pub fn new() -> Self { Self { _private: () } } @@ -1569,7 +1569,7 @@ impl<'a, F> fmt::Debug for FieldFnVisitor<'a, F> { /// Configures what points in the span lifecycle are logged as events. /// -/// See also [`with_span_events`](../struct.SubscriberBuilder.html#method.with_span_events). +/// See also [`with_span_events`](super::SubscriberBuilder.html::with_span_events). #[derive(Clone, Eq, PartialEq, Ord, PartialOrd)] pub struct FmtSpan(u8); diff --git a/tracing-subscriber/src/fmt/mod.rs b/tracing-subscriber/src/fmt/mod.rs index e9a082e59a..1657d71b8f 100644 --- a/tracing-subscriber/src/fmt/mod.rs +++ b/tracing-subscriber/src/fmt/mod.rs @@ -18,7 +18,7 @@ //! //! *Compiler support: [requires `rustc` 1.49+][msrv]* //! -//! [msrv]: ../index.html#supported-rust-versions +//! [msrv]: super#supported-rust-versions //! //! Add the following to your executable to initialize the default subscriber: //! ```rust @@ -163,7 +163,7 @@ //! //! ### Composing Layers //! -//! Composing an [`EnvFilter`] `Layer` and a [format `Layer`](../fmt/struct.Layer.html): +//! Composing an [`EnvFilter`] `Layer` and a [format `Layer`][super::fmt::Layer]: //! //! ```rust //! use tracing_subscriber::{fmt, EnvFilter}; @@ -181,11 +181,11 @@ //! .init(); //! ``` //! -//! [`EnvFilter`]: ../filter/struct.EnvFilter.html +//! [`EnvFilter`]: super::filter::EnvFilter //! [`env_logger`]: https://docs.rs/env_logger/ -//! [`filter`]: ../filter/index.html -//! [`SubscriberBuilder`]: ./struct.SubscriberBuilder.html -//! [`FmtSubscriber`]: ./struct.Subscriber.html +//! [`filter`]: super::filter +//! [`SubscriberBuilder`]: SubscriberBuilder +//! [`FmtSubscriber`]: Subscriber //! [`Subscriber`]: //! https://docs.rs/tracing/latest/tracing/trait.Subscriber.html //! [`tracing`]: https://crates.io/crates/tracing @@ -313,7 +313,7 @@ pub struct SubscriberBuilder< /// ``` /// /// [formatting subscriber]: Subscriber -/// [`SubscriberBuilder::default()`]: struct.SubscriberBuilder.html#method.default +/// [`SubscriberBuilder::default()`]: SubscriberBuilder::default /// [`init`]: SubscriberBuilder::init() /// [`try_init`]: SubscriberBuilder::try_init() /// [`finish`]: SubscriberBuilder::finish() @@ -329,7 +329,7 @@ pub fn fmt() -> SubscriberBuilder { /// /// [formatting layer]: Layer /// [composed]: crate::layer -/// [`Layer::default()`]: struct.Layer.html#method.default +/// [`Layer::default()`]: Layer::default #[cfg_attr(docsrs, doc(cfg(all(feature = "fmt", feature = "std"))))] pub fn layer() -> Layer { Layer::default() @@ -342,7 +342,7 @@ impl Subscriber { /// This can be overridden with the [`SubscriberBuilder::with_max_level`] method. /// /// [verbosity level]: https://docs.rs/tracing-core/0.1.5/tracing_core/struct.Level.html - /// [`SubscriberBuilder::with_max_level`]: struct.SubscriberBuilder.html#method.with_max_level + /// [`SubscriberBuilder::with_max_level`]: SubscriberBuilder::with_max_level pub const DEFAULT_MAX_LEVEL: LevelFilter = LevelFilter::INFO; /// Returns a new `SubscriberBuilder` for configuring a format subscriber. @@ -721,7 +721,7 @@ where /// Sets the subscriber being built to use a JSON formatter. /// - /// See [`format::Json`](../fmt/format/struct.Json.html) + /// See [`format::Json`][super::fmt::format::Json] #[cfg(feature = "json")] #[cfg_attr(docsrs, doc(cfg(feature = "json")))] pub fn json( @@ -742,7 +742,7 @@ where impl SubscriberBuilder, F, W> { /// Sets the json subscriber being built to flatten event metadata. /// - /// See [`format::Json`](../fmt/format/struct.Json.html) + /// See [`format::Json`][super::fmt::format::Json] pub fn flatten_event( self, flatten_event: bool, @@ -756,7 +756,7 @@ impl SubscriberBuilder SubscriberBuilder SubscriberBuilder { /// .try_init()?; /// # Ok(())} /// ``` - /// [`EnvFilter`]: ../filter/struct.EnvFilter.html + /// [`EnvFilter`]: super::filter::EnvFilter /// [`with_max_level`]: #method.with_max_level #[cfg(feature = "env-filter")] #[cfg_attr(docsrs, doc(cfg(feature = "env-filter")))] @@ -1029,7 +1029,7 @@ impl SubscriberBuilder { /// /// [capturing]: /// https://doc.rust-lang.org/book/ch11-02-running-tests.html#showing-function-output - /// [`TestWriter`]: writer/struct.TestWriter.html + /// [`TestWriter`]: writer::TestWriter pub fn with_test_writer(self) -> SubscriberBuilder { SubscriberBuilder { filter: self.filter, @@ -1138,8 +1138,7 @@ impl SubscriberBuilder { /// /// [`LogTracer`]: /// https://docs.rs/tracing-log/0.1.0/tracing_log/struct.LogTracer.html -/// [`RUST_LOG` environment variable]: -/// ../filter/struct.EnvFilter.html#associatedconstant.DEFAULT_ENV +/// [`RUST_LOG` environment variable]: crate::filter::EnvFilter::DEFAULT_ENV pub fn try_init() -> Result<(), Box> { let builder = Subscriber::builder(); @@ -1195,8 +1194,7 @@ pub fn try_init() -> Result<(), Box> { /// Panics if the initialization was unsuccessful, likely because a /// global subscriber was already installed by another call to `try_init`. /// -/// [`RUST_LOG` environment variable]: -/// ../filter/struct.EnvFilter.html#associatedconstant.DEFAULT_ENV +/// [`RUST_LOG` environment variable]: crate::filter::EnvFilter::DEFAULT_ENV pub fn init() { try_init().expect("Unable to install global subscriber") } diff --git a/tracing-subscriber/src/fmt/time/mod.rs b/tracing-subscriber/src/fmt/time/mod.rs index fe5231dc72..e5b7c83b04 100644 --- a/tracing-subscriber/src/fmt/time/mod.rs +++ b/tracing-subscriber/src/fmt/time/mod.rs @@ -30,7 +30,7 @@ pub use time_crate::OffsetTime; /// /// The full list of provided implementations can be found in [`time`]. /// -/// [`time`]: ./index.html +/// [`time`]: self pub trait FormatTime { /// Measure and write out the current time. /// diff --git a/tracing-subscriber/src/fmt/writer.rs b/tracing-subscriber/src/fmt/writer.rs index 6a284ce97b..09897736ad 100644 --- a/tracing-subscriber/src/fmt/writer.rs +++ b/tracing-subscriber/src/fmt/writer.rs @@ -501,8 +501,8 @@ pub trait MakeWriterExt<'a>: MakeWriter<'a> { /// Writing to [`io::stdout`] and [`io::stderr`] produces the same results as using /// [`libtest`'s `--nocapture` option][nocapture] which may make the results look unreadable. /// -/// [`fmt::Subscriber`]: ../struct.Subscriber.html -/// [`fmt::Layer`]: ../struct.Layer.html +/// [`fmt::Subscriber`]: super::Subscriber +/// [`fmt::Layer`]: super::Layer /// [capturing]: https://doc.rust-lang.org/book/ch11-02-running-tests.html#showing-function-output /// [nocapture]: https://doc.rust-lang.org/cargo/commands/cargo-test.html /// [`io::stdout`]: https://doc.rust-lang.org/std/io/fn.stdout.html @@ -649,7 +649,7 @@ pub struct Tee { /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html /// [`MutexGuard`]: https://doc.rust-lang.org/std/sync/struct.MutexGuard.html /// [`Mutex`]: https://doc.rust-lang.org/std/sync/struct.Mutex.html -/// [`MakeWriter`]: trait.MakeWriter.html +/// [`MakeWriter`]: MakeWriter #[derive(Debug)] pub struct MutexGuardWriter<'a, W>(MutexGuard<'a, W>); @@ -734,7 +734,7 @@ impl<'a> MakeWriter<'a> for TestWriter { impl BoxMakeWriter { /// Constructs a `BoxMakeWriter` wrapping a type implementing [`MakeWriter`]. /// - /// [`MakeWriter`]: trait.MakeWriter.html + /// [`MakeWriter`]: MakeWriter pub fn new(make_writer: M) -> Self where M: for<'a> MakeWriter<'a> + Send + Sync + 'static, diff --git a/tracing-subscriber/src/layer/context.rs b/tracing-subscriber/src/layer/context.rs index e119595260..04b097dcf6 100644 --- a/tracing-subscriber/src/layer/context.rs +++ b/tracing-subscriber/src/layer/context.rs @@ -25,10 +25,10 @@ use crate::{filter::FilterId, registry::Registry}; /// } /// ``` /// -/// [`Layer`]: ../layer/trait.Layer.html +/// [`Layer`]: super::Layer /// [`Subscriber`]: https://docs.rs/tracing-core/latest/tracing_core/trait.Subscriber.html -/// [stored data]: ../registry/struct.SpanRef.html -/// [`LookupSpan`]: "../registry/trait.LookupSpan.html +/// [stored data]: crate::registry::SpanRef +/// [`LookupSpan`]: crate::registry::LookupSpan #[derive(Debug)] pub struct Context<'a, S> { subscriber: Option<&'a S>, @@ -206,7 +206,7 @@ where /// declaration for details. /// /// - /// [stored data]: ../registry/struct.SpanRef.html + /// [stored data]: crate::registry::SpanRef #[inline] pub fn span(&self, id: &span::Id) -> Option> where @@ -251,7 +251,7 @@ where /// declaration for details. /// /// - /// [stored data]: ../registry/struct.SpanRef.html + /// [stored data]: crate::registry::SpanRef #[inline] pub fn lookup_current(&self) -> Option> where @@ -333,7 +333,7 @@ where /// declaration for details. /// /// - /// [stored data]: ../registry/struct.SpanRef.html + /// [stored data]: crate::registry::SpanRef pub fn span_scope(&self, id: &span::Id) -> Option> where S: for<'lookup> LookupSpan<'lookup>, @@ -360,7 +360,7 @@ where /// declaration for details. /// /// - /// [stored data]: ../registry/struct.SpanRef.html + /// [stored data]: crate::registry::SpanRef pub fn event_scope(&self, event: &Event<'_>) -> Option> where S: for<'lookup> LookupSpan<'lookup>, diff --git a/tracing-subscriber/src/layer/mod.rs b/tracing-subscriber/src/layer/mod.rs index 91fb325687..17b9e6ba99 100644 --- a/tracing-subscriber/src/layer/mod.rs +++ b/tracing-subscriber/src/layer/mod.rs @@ -793,7 +793,7 @@ where /// with `Layer`s. /// /// [`Interest`]: https://docs.rs/tracing-core/latest/tracing_core/struct.Interest.html - /// [`Context`]: ../struct.Context.html + /// [`Context`]: Context /// [`Subscriber::enabled`]: https://docs.rs/tracing-core/latest/tracing_core/trait.Subscriber.html#method.enabled /// [`Layer::register_callsite`]: #method.register_callsite /// [`on_event`]: #method.on_event diff --git a/tracing-subscriber/src/lib.rs b/tracing-subscriber/src/lib.rs index 2ec40de5d3..85d5feeff6 100644 --- a/tracing-subscriber/src/lib.rs +++ b/tracing-subscriber/src/lib.rs @@ -151,8 +151,8 @@ //! //! [`tracing`]: https://docs.rs/tracing/latest/tracing/ //! [`Subscriber`]: https://docs.rs/tracing-core/latest/tracing_core/subscriber/trait.Subscriber.html -//! [`EnvFilter`]: filter/struct.EnvFilter.html -//! [`fmt`]: fmt/index.html +//! [`EnvFilter`]: filter::EnvFilter +//! [`fmt`]: mod@fmt //! [`tracing-log`]: https://crates.io/crates/tracing-log //! [`smallvec`]: https://crates.io/crates/smallvec //! [`env_logger` crate]: https://crates.io/crates/env_logger diff --git a/tracing-subscriber/src/registry/mod.rs b/tracing-subscriber/src/registry/mod.rs index f3b77b6a95..fbe036cdc9 100644 --- a/tracing-subscriber/src/registry/mod.rs +++ b/tracing-subscriber/src/registry/mod.rs @@ -87,9 +87,9 @@ feature! { /// implement this trait; if they do, any [`Layer`]s wrapping them can look up /// metadata via the [`Context`] type's [`span()`] method. /// -/// [`Layer`]: ../layer/trait.Layer.html -/// [`Context`]: ../layer/struct.Context.html -/// [`span()`]: ../layer/struct.Context.html#method.span +/// [`Layer`]: super::layer::Layer +/// [`Context`]: super::layer::Context +/// [`span()`]: super::layer::Context::span pub trait LookupSpan<'a> { /// The type of span data stored in this registry. type Data: SpanData<'a>; @@ -104,7 +104,7 @@ pub trait LookupSpan<'a> { /// capable of performing more sophisiticated queries. /// /// - /// [`SpanData`]: trait.SpanData.html + /// [`SpanData`]: SpanData fn span_data(&'a self, id: &Id) -> Option; /// Returns a [`SpanRef`] for the span with the given `Id`, if it exists. @@ -116,8 +116,8 @@ pub trait LookupSpan<'a> { /// rather than the [`span_data`] method; while _implementors_ of this trait /// should only implement `span_data`. /// - /// [`SpanRef`]: struct.SpanRef.html - /// [`SpanData`]: trait.SpanData.html + /// [`SpanRef`]: SpanRef + /// [`SpanData`]: SpanData /// [`span_data`]: #method.span_data fn span(&'a self, id: &Id) -> Option> where @@ -208,8 +208,8 @@ pub trait SpanData<'a> { /// provides additional methods for querying the registry based on values from /// the span. /// -/// [span data]: trait.SpanData.html -/// [registry]: trait.LookupSpan.html +/// [span data]: SpanData +/// [registry]: LookupSpan #[derive(Debug)] pub struct SpanRef<'a, R: LookupSpan<'a>> { registry: &'a R, diff --git a/tracing-subscriber/src/registry/sharded.rs b/tracing-subscriber/src/registry/sharded.rs index c714409ef7..348c204bcb 100644 --- a/tracing-subscriber/src/registry/sharded.rs +++ b/tracing-subscriber/src/registry/sharded.rs @@ -102,9 +102,9 @@ pub struct Registry { /// [`Layer`s], such as formatted fields, metrics, or distributed traces should /// be stored in the [extensions] typemap. /// -/// [`Registry`]: struct.Registry.html -/// [`Layer`s]: ../layer/trait.Layer.html -/// [extensions]: struct.Extensions.html +/// [`Registry`]: Registry +/// [`Layer`s]: crate::layer::Layer +/// [extensions]: Extensions #[cfg(feature = "registry")] #[cfg_attr(docsrs, doc(cfg(all(feature = "registry", feature = "std"))))] #[derive(Debug)] @@ -173,7 +173,7 @@ fn id_to_idx(id: &Id) -> usize { /// greater than 0, `CloseGuard` decrements the counter by one and /// _does not_ remove the span from the [`Registry`]. /// -/// [`Registry`]: ./struct.Registry.html +/// [`Registry`]: Registry pub(crate) struct CloseGuard<'a> { id: Id, registry: &'a Registry, @@ -189,7 +189,7 @@ impl Registry { /// processed an `on_close` notification via the `CLOSE_COUNT` thread-local. /// For additional details, see [`CloseGuard`]. /// - /// [`CloseGuard`]: ./struct.CloseGuard.html + /// [`CloseGuard`]: CloseGuard pub(crate) fn start_close(&self, id: Id) -> CloseGuard<'_> { CLOSE_COUNT.with(|count| { let c = count.get(); @@ -216,7 +216,7 @@ thread_local! { /// track how many layers have processed the close. /// For additional details, see [`CloseGuard`]. /// - /// [`CloseGuard`]: ./struct.CloseGuard.html + /// [`CloseGuard`]: CloseGuard static CLOSE_COUNT: Cell = Cell::new(0); } diff --git a/tracing-subscriber/src/reload.rs b/tracing-subscriber/src/reload.rs index fb300e380e..422917a413 100644 --- a/tracing-subscriber/src/reload.rs +++ b/tracing-subscriber/src/reload.rs @@ -52,8 +52,8 @@ //! info!("This will be logged"); //! ``` //! -//! [`Layer` type]: struct.Layer.html -//! [`Layer` trait]: ../layer/trait.Layer.html +//! [`Layer` type]: Layer +//! [`Layer` trait]: super::layer::Layer use crate::layer; use crate::sync::RwLock; diff --git a/tracing/src/dispatcher.rs b/tracing/src/dispatcher.rs index 8e760a3913..568a0314d6 100644 --- a/tracing/src/dispatcher.rs +++ b/tracing/src/dispatcher.rs @@ -122,11 +122,11 @@ //! currently default `Dispatch`. This is used primarily by `tracing` //! instrumentation. //! -//! [`Subscriber`]: trait.Subscriber.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 +//! [`Subscriber`]: crate::Subscriber +//! [`with_default`]: with_default +//! [`set_global_default`]: set_global_default +//! [`get_default`]: get_default +//! [`Dispatch`]: Dispatch #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] pub use tracing_core::dispatcher::set_default; diff --git a/tracing/src/level_filters.rs b/tracing/src/level_filters.rs index 6052a1a65e..44f5e5f57a 100644 --- a/tracing/src/level_filters.rs +++ b/tracing/src/level_filters.rs @@ -62,7 +62,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::cfg_if! { diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs index 4a78c8fd72..880ac4923c 100644 --- a/tracing/src/lib.rs +++ b/tracing/src/lib.rs @@ -434,13 +434,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 //! @@ -454,19 +454,19 @@ //! 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! +//! [`Level`]: Level //! //! ### For `log` Users //! @@ -890,7 +890,7 @@ //! [`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 +//! [static verbosity level]: level_filters#compile-time-filters //! [instrument]: https://docs.rs/tracing-attributes/latest/tracing_attributes/attr.instrument.html //! [flags]: #crate-feature-flags #![cfg_attr(not(feature = "std"), no_std)] diff --git a/tracing/src/macros.rs b/tracing/src/macros.rs index 0a599c6bb7..bf7cf54860 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 /// @@ -138,10 +138,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!`]: crate::span! /// /// # Examples /// @@ -219,10 +219,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!`]: crate::span! /// /// # Examples /// @@ -300,10 +300,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!`]: crate::span! /// /// # Examples /// @@ -381,10 +381,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!`]: crate::span! /// /// # Examples /// @@ -461,10 +461,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!`]: crate::span! /// /// # Examples /// @@ -543,7 +543,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 /// @@ -1049,8 +1049,8 @@ macro_rules! enabled { /// documentation][lib] for details on the syntax accepted by /// this macro. /// -/// [`event!`]: macro.event.html -/// [lib]: index.html#using-the-macros +/// [`event!`]: crate::event! +/// [lib]: crate#using-the-macros /// /// # Examples /// @@ -1249,8 +1249,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!`]: crate::event! +/// [lib]: crate#using-the-macros /// /// # Examples /// @@ -1450,8 +1450,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!`]: crate::event! +/// [lib]: crate#using-the-macros /// /// # Examples /// @@ -1662,8 +1662,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!`]: crate::event! +/// [lib]: crate#using-the-macros /// /// # Examples /// @@ -1867,8 +1867,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!`]: crate::event! +/// [lib]: crate#using-the-macros /// /// # Examples /// diff --git a/tracing/src/span.rs b/tracing/src/span.rs index bc3cd59f66..8379977fbd 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 @@ -381,7 +381,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> { @@ -429,10 +429,10 @@ impl Span { /// After the span is constructed, [field values] and/or [`follows_from`] /// annotations may be added to it. /// - /// [metadata]: ../metadata - /// [`Subscriber`]: ../subscriber/trait.Subscriber.html - /// [field values]: ../field/struct.ValueSet.html - /// [`follows_from`]: ../struct.Span.html#method.follows_from + /// [metadata]: super::Metadata + /// [`Subscriber`]: super::subscriber::Subscriber + /// [field values]: super::field::ValueSet + /// [`follows_from`]: super::Span::follows_from pub fn new(meta: &'static Metadata<'static>, values: &field::ValueSet<'_>) -> Span { dispatcher::get_default(|dispatch| Self::new_with(meta, values, dispatch)) } @@ -454,9 +454,9 @@ impl Span { /// After the span is constructed, [field values] and/or [`follows_from`] /// annotations may be added to it. /// - /// [metadata]: ../metadata - /// [field values]: ../field/struct.ValueSet.html - /// [`follows_from`]: ../struct.Span.html#method.follows_from + /// [metadata]: super::Metadata + /// [field values]: super::field::ValueSet + /// [`follows_from`]: super::Span::follows_from pub fn new_root(meta: &'static Metadata<'static>, values: &field::ValueSet<'_>) -> Span { dispatcher::get_default(|dispatch| Self::new_root_with(meta, values, dispatch)) } @@ -478,9 +478,9 @@ impl Span { /// After the span is constructed, [field values] and/or [`follows_from`] /// annotations may be added to it. /// - /// [metadata]: ../metadata - /// [field values]: ../field/struct.ValueSet.html - /// [`follows_from`]: ../struct.Span.html#method.follows_from + /// [metadata]: super::Metadata + /// [field values]: super::field::ValueSet + /// [`follows_from`]: super::Span::follows_from pub fn child_of( parent: impl Into>, meta: &'static Metadata<'static>, @@ -544,7 +544,8 @@ 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 `Subscriber`]: ../subscriber/trait.Subscriber.html#method.current + /// [considered by the `Subscriber`]: + /// super::subscriber::Subscriber::current_span pub fn current() -> Span { dispatcher::get_default(|dispatch| { if let Some((id, meta)) = dispatch.current_span().into_inner() { @@ -714,7 +715,7 @@ impl Span { /// [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 + /// [attr]: macro@crate::instrument /// /// # Examples /// @@ -1096,7 +1097,7 @@ impl Span { f() } - /// Returns a [`Field`](../field/struct.Field.html) for the field with the + /// Returns a [`Field`][super::field::Field] for the field with the /// given `name`, if one exists, pub fn field(&self, field: &Q) -> Option where @@ -1106,7 +1107,7 @@ impl Span { } /// Returns true if this `Span` has a field for the given - /// [`Field`](../field/struct.Field.html) or field name. + /// [`Field`][super::field::Field] or field name. #[inline] pub fn has_field(&self, field: &Q) -> bool where @@ -1183,8 +1184,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, diff --git a/tracing/src/subscriber.rs b/tracing/src/subscriber.rs index 8f35d84e09..343dc5914c 100644 --- a/tracing/src/subscriber.rs +++ b/tracing/src/subscriber.rs @@ -12,9 +12,9 @@ pub use tracing_core::dispatcher::DefaultGuard; /// executing, new spans or events are dispatched to the subscriber that /// tagged that span, instead. /// -/// [`Span`]: ../span/struct.Span.html -/// [`Subscriber`]: ../subscriber/trait.Subscriber.html -/// [`Event`]: :../event/struct.Event.html +/// [`Span`]: super::span::Span +/// [`Subscriber`]: super::subscriber::Subscriber +/// [`Event`]: super::event::Event #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] pub fn with_default(subscriber: S, f: impl FnOnce() -> T) -> T @@ -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 -/// [`Subscriber`]: ../subscriber/trait.Subscriber.html -/// [`Event`]: ../event/struct.Event.html +/// [span]: super::span +/// [`Subscriber`]: super::subscriber::Subscriber +/// [`Event`]: super::event::Event pub fn set_global_default(subscriber: S) -> Result<(), SetGlobalDefaultError> where S: Subscriber + Send + Sync + 'static, @@ -51,10 +51,10 @@ where /// executing, new spans or events are dispatched to the subscriber that /// tagged that span, instead. /// -/// [`Span`]: ../span/struct.Span.html -/// [`Subscriber`]: ../subscriber/trait.Subscriber.html -/// [`Event`]: :../event/struct.Event.html -/// [`DefaultGuard`]: ../dispatcher/struct.DefaultGuard.html +/// [`Span`]: super::span::Span +/// [`Subscriber`]: super::subscriber::Subscriber +/// [`Event`]: super::event::Event +/// [`DefaultGuard`]: super::dispatcher::DefaultGuard #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] #[must_use = "Dropping the guard unregisters the subscriber."]