Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Switch to even more intra-doc links #1084

Merged
merged 5 commits into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tracing-appender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
//!
//! The [`non_blocking` module][non_blocking]'s documentation provides more detail on how to use `non_blocking`.
//!
//! [write]: https://doc.rust-lang.org/std/io/trait.Write.html
//! [write]: std::io::Write
//! [non_blocking]: mod@non_blocking
//! [guard]: non_blocking::WorkerGuard
//! [make_writer]: tracing_subscriber::fmt::MakeWriter
Expand Down
8 changes: 4 additions & 4 deletions tracing-appender/src/rolling.rs
Original file line number Diff line number Diff line change
@@ -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`].
//! 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.
//!
Expand Down Expand Up @@ -38,7 +38,7 @@ use std::path::Path;
/// It may be used with [`NonBlocking`][non-blocking] to perform writes without
/// blocking the current thread.
///
/// [write]: https://doc.rust-lang.org/nightly/std/io/trait.Write.html
/// [write]: std::io::Write
/// [non-blocking]: super::non_blocking::NonBlocking
///
/// # Examples
Expand All @@ -57,7 +57,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`]. 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.
Expand Down Expand Up @@ -180,7 +180,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`]. 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.
///
Expand Down
2 changes: 1 addition & 1 deletion tracing-attributes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ use syn::{
///
/// [span]: https://docs.rs/tracing/latest/tracing/span/index.html
/// [`tracing`]: https://github.com/tokio-rs/tracing
/// [`fmt::Debug`]: https://doc.rust-lang.org/std/fmt/trait.Debug.html
/// [`fmt::Debug`]: std::fmt::Debug
#[proc_macro_attribute]
pub fn instrument(
args: proc_macro::TokenStream,
Expand Down
4 changes: 2 additions & 2 deletions tracing-core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
4 changes: 2 additions & 2 deletions tracing-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
//! All other features of `tracing-core` should behave identically with and
//! without `std` and `alloc`.
//!
//! [`libstd`]: https://doc.rust-lang.org/std/index.html
//! [`libstd`]: std
//! [`Dispatch::new`]: crate::dispatch::Dispatch::new
//! [`Dispatch::from_static`]: crate::dispatch::Dispatch::from_static
//! [`Dispatch::set_default`]: crate::dispatch::set_default
Expand All @@ -104,7 +104,7 @@
//! * `std`: Depend on the Rust standard library (enabled by default).
//! * `alloc`: Depend on [`liballoc`] (enabled by "std").
//!
//! [`liballoc`]: https://doc.rust-lang.org/alloc/index.html
//! [`liballoc`]: alloc
//!
//! ## Supported Rust Versions
//!
Expand Down
5 changes: 2 additions & 3 deletions tracing-error/src/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ use tracing::{Metadata, Span};
/// Additionally, if custom formatting is desired, the [`with_spans`] method can
/// be used to visit each span in the trace, formatting them in order.
///
/// [`tracing`]: https://docs.rs/tracing
/// [`Backtrace`]: https://doc.rust-lang.org/std/backtrace/struct.Backtrace.html
/// [`Backtrace`]: std::backtrace::Backtrace
/// [span]: mod@tracing::span
/// [parents]: mod@tracing::span#span-relationships
/// [fields]: tracing::field
/// [futures]: https://doc.rust-lang.org/std/future/trait.Future.html
/// [futures]: std::future::Future
/// [`tracing-futures`]: https://docs.rs/tracing-futures/
/// [`with_spans`]: SpanTrace::with_spans()
#[derive(Clone)]
Expand Down
2 changes: 0 additions & 2 deletions tracing-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@
//! [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
//!
//! ## Supported Rust Versions
//!
Expand Down
1 change: 0 additions & 1 deletion tracing-flame/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
//! the execution of your program. This representation is best created with a
//! _flamechart_, which _does not_ sort or collapse identical stack frames.
//!
//! [`tracing`]: https://docs.rs/tracing
//! [`inferno`]: https://docs.rs/inferno
//! [`inferno-flamegraph`]: https://docs.rs/inferno/0.9.5/inferno/index.html#producing-a-flame-graph
//!
Expand Down
8 changes: 4 additions & 4 deletions tracing-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@
//! [`tracing`]: https://crates.io/crates/tracing
//! [`log`]: https://crates.io/crates/log
//! [`env_logger` crate]: https://crates.io/crates/env-logger
//! [`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
//! [`tracing::Collector`]: tracing::Collect
//! [`tracing::Event`]: tracing_core::Event
//! [`Collect`]: tracing::Collect
//! [flags]: https://docs.rs/tracing/latest/tracing/#crate-feature-flags
#![doc(html_root_url = "https://docs.rs/tracing-log/0.1.1")]
#![doc(
Expand Down Expand Up @@ -373,7 +373,7 @@ impl AsTrace for log::Level {
/// to allow accessing its complete metadata in a consistent way,
/// regardless of the source of its source.
///
/// [`normalized_metadata`]: trait.NormalizeEvent.html#normalized_metadata
/// [`normalized_metadata`]: NormalizeEvent#normalized_metadata
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
Expand Down
1 change: 0 additions & 1 deletion tracing-log/src/log_tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
//! such as when a crate emits both `tracing` diagnostics _and_ log records by
//! default.
//!
//! [`log`]: https://docs.rs/log/0.4.8/log/
//! [logger interface]: log::Log
//! [`init`]: LogTracer.html#method.init
//! [`init_with_filter`]: LogTracer.html#method.init_with_filter
Expand Down
2 changes: 1 addition & 1 deletion tracing-serde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! [![Documentation (master)][docs-master-badge]][docs-master-url]
//!
//! [docs-badge]: https://docs.rs/tracing-serde/badge.svg
//! [docs-url]: https://docs.rs/tracing-serde
//! [docs-url]: crate
//! [docs-master-badge]: https://img.shields.io/badge/docs-master-blue
//! [docs-master-url]: https://tracing-rs.netlify.com/tracing_serde
//!
Expand Down
16 changes: 8 additions & 8 deletions tracing-subscriber/src/fmt/fmt_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub struct Subscriber<S, N = format::DefaultFields, E = format::Format, W = fn()
}

impl<S> Subscriber<S> {
/// Returns a new [`Subscriber`](struct.Subscriber.html) with the default configuration.
/// Returns a new [`Subscriber`] with the default configuration.
pub fn new() -> Self {
Self::default()
}
Expand Down Expand Up @@ -292,7 +292,7 @@ where
/// Sets whether or not the [thread ID] of the current thread is displayed
/// when formatting events
///
/// [thread ID]: https://doc.rust-lang.org/stable/std/thread/struct.ThreadId.html
/// [thread ID]: std::thread::ThreadId
pub fn with_thread_ids(
self,
display_thread_ids: bool,
Expand All @@ -309,7 +309,7 @@ where
/// Sets whether or not the [name] of the current thread is displayed
/// when formatting events
///
/// [name]: https://doc.rust-lang.org/stable/std/thread/index.html#naming-threads
/// [name]: std::thread#naming-threads
pub fn with_thread_names(
self,
display_thread_names: bool,
Expand All @@ -323,7 +323,7 @@ where
}
}

/// Sets the subscriber being built to use a [less verbose formatter](../fmt/format/struct.Compact.html).
/// Sets the subscriber being built to use a [less verbose formatter](format::Compact).
pub fn compact(self) -> Subscriber<S, N, format::Format<format::Compact, T>, W>
where
N: for<'writer> FormatFields<'writer> + 'static,
Expand All @@ -350,7 +350,7 @@ where
}
}

/// Sets the subscriber being built to use a [JSON formatter](../fmt/format/struct.Json.html).
/// Sets the subscriber being built to use a [JSON formatter](format::Json).
///
/// The full format includes fields from all entered spans.
///
Expand Down Expand Up @@ -383,7 +383,7 @@ where
impl<S, T, W> Subscriber<S, format::JsonFields, format::Format<format::Json, T>, W> {
/// Sets the JSON layer being built to flatten event metadata.
///
/// See [`format::Json`](../fmt/format/struct.Json.html)
/// See [`format::Json`]
pub fn flatten_event(
self,
flatten_event: bool,
Expand All @@ -400,7 +400,7 @@ impl<S, T, W> Subscriber<S, format::JsonFields, format::Format<format::Json, T>,
/// 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`]
pub fn with_current_span(
self,
display_current_span: bool,
Expand All @@ -417,7 +417,7 @@ impl<S, T, W> Subscriber<S, format::JsonFields, format::Format<format::Json, T>,
/// 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`]
pub fn with_span_list(
self,
display_span_list: bool,
Expand Down
12 changes: 6 additions & 6 deletions tracing-subscriber/src/fmt/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ impl<F, T> Format<F, T> {
/// Sets whether or not the [thread ID] of the current thread is displayed
/// when formatting events
///
/// [thread ID]: https://doc.rust-lang.org/stable/std/thread/struct.ThreadId.html
/// [thread ID]: std::thread::ThreadId
pub fn with_thread_ids(self, display_thread_id: bool) -> Format<F, T> {
Format {
display_thread_id,
Expand All @@ -336,7 +336,7 @@ impl<F, T> Format<F, T> {
/// Sets whether or not the [name] of the current thread is displayed
/// when formatting events
///
/// [name]: https://doc.rust-lang.org/stable/std/thread/index.html#naming-threads
/// [name]: std::thread#naming-threads
pub fn with_thread_names(self, display_thread_name: bool) -> Format<F, T> {
Format {
display_thread_name,
Expand Down Expand Up @@ -376,7 +376,7 @@ impl<T> Format<Json, T> {
/// ```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`]
#[cfg(feature = "json")]
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
pub fn flatten_event(mut self, flatten_event: bool) -> Format<Json, T> {
Expand All @@ -387,7 +387,7 @@ impl<T> Format<Json, T> {
/// Sets whether or not the formatter will include the current span in
/// formatted events.
///
/// See [`format::Json`](../fmt/format/struct.Json.html)
/// See [`Json`]
#[cfg(feature = "json")]
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
pub fn with_current_span(mut self, display_current_span: bool) -> Format<Json, T> {
Expand All @@ -398,7 +398,7 @@ impl<T> Format<Json, T> {
/// 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 [`Json`]
#[cfg(feature = "json")]
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
pub fn with_span_list(mut self, display_span_list: bool) -> Format<Json, T> {
Expand Down Expand Up @@ -971,7 +971,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::CollectorBuilder::with_span_events()).
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd)]
pub struct FmtSpan(FmtSpanInner);

Expand Down
14 changes: 7 additions & 7 deletions tracing-subscriber/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
//!
//! ### Composing Subscribers
//!
//! Composing an [`EnvFilter`] `Subscribe` and a [format `Subscribe`](../fmt/struct.Subscriber.html):
//! Composing an [`EnvFilter`] `Subscribe` and a [format `Subscribe`](super::fmt::Subscriber):
//!
//! ```rust
//! use tracing_subscriber::{fmt, EnvFilter};
Expand Down Expand Up @@ -700,7 +700,7 @@ where
/// Sets whether or not the [name] of the current thread is displayed
/// when formatting events
///
/// [name]: https://doc.rust-lang.org/stable/std/thread/index.html#naming-threads
/// [name]: std::thread#naming-threads
pub fn with_thread_names(
self,
display_thread_names: bool,
Expand All @@ -714,7 +714,7 @@ where
/// Sets whether or not the [thread ID] of the current thread is displayed
/// when formatting events
///
/// [thread ID]: https://doc.rust-lang.org/stable/std/thread/struct.ThreadId.html
/// [thread ID]: std::thread::ThreadId
pub fn with_thread_ids(
self,
display_thread_ids: bool,
Expand Down Expand Up @@ -752,7 +752,7 @@ where

/// Sets the collector 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(self) -> CollectorBuilder<format::JsonFields, format::Format<format::Json, T>, F, W>
Expand All @@ -771,7 +771,7 @@ where
impl<T, F, W> CollectorBuilder<format::JsonFields, format::Format<format::Json, T>, F, W> {
/// Sets the json collector 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,
Expand All @@ -785,7 +785,7 @@ impl<T, F, W> CollectorBuilder<format::JsonFields, format::Format<format::Json,
/// Sets whether or not the JSON subscriber being built will include the current span
/// in formatted events.
///
/// See [`format::Json`](../fmt/format/struct.Json.html)
/// See [`format::Json`](super::fmt::format::Json)
pub fn with_current_span(
self,
display_current_span: bool,
Expand All @@ -799,7 +799,7 @@ impl<T, F, W> CollectorBuilder<format::JsonFields, format::Format<format::Json,
/// Sets whether or not the JSON subscriber being built 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::fmt::format::Json)
pub fn with_span_list(
self,
display_span_list: bool,
Expand Down
Loading