Skip to content
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
17 changes: 7 additions & 10 deletions tracing-appender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! *Compiler support: [requires `rustc` 1.42+][msrv]*
//!
//! [msrv]: #supported-rust-versions
//! [file_appender]: ./rolling/struct.RollingFileAppender.html
//! [file_appender]: rolling::RollingFileAppender
//! [tracing]: https://docs.rs/tracing/
//!
//! # Usage
Expand All @@ -21,9 +21,9 @@
//! ```
//!
//! This crate can be used in a few ways to record spans/events:
//! - Using a [`RollingFileAppender`][rolling_struct] to perform writes to a log file. This will block on writes.
//! - Using a [`RollingFileAppender`] to perform writes to a log file. This will block on writes.
//! - Using *any* type implementing [`std::io::Write`][write] in a non-blocking fashion.
//! - Using a combination of [`NonBlocking`][non_blocking] and [`RollingFileAppender`][rolling_struct] to allow writes to a log file
//! - Using a combination of [`NonBlocking`] and [`RollingFileAppender`] to allow writes to a log file
//! without blocking.
//!
//! ## Rolling File Appender
Expand Down Expand Up @@ -88,12 +88,11 @@
//!
//! The [`non_blocking` module][non_blocking]'s documentation provides more detail on how to use `non_blocking`.
//!
//! [non_blocking]: ./non_blocking/index.html
//! [write]: https://doc.rust-lang.org/std/io/trait.Write.html
//! [guard]: ./non_blocking/struct.WorkerGuard.html
//! [rolling]: ./rolling/index.html
//! [non_blocking]: mod@non_blocking
//! [guard]: non_blocking::WorkerGuard
//! [make_writer]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/trait.MakeWriter.html
//! [rolling_struct]: ./rolling/struct.RollingFileAppender.html
//! [`RollingFileAppender`]: rolling::RollingFileAppender
//! [fmt_subscriber]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/struct.Subscriber.html
//!
//! ## Non-Blocking Rolling File Appender
Expand Down Expand Up @@ -165,9 +164,7 @@ mod worker;

/// Convenience function for creating a non-blocking, off-thread writer.
///
/// See the [`non_blocking` module's docs][non_blocking]'s for more details.
///
/// [non_blocking]: ./non_blocking/index.html
/// See the [`non_blocking` module's docs][mod@non_blocking]'s for more details.
///
/// # Examples
///
Expand Down
13 changes: 6 additions & 7 deletions tracing-appender/src/non_blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! tracing_appender::non_blocking(std::io::stdout())
//! # }
//! ```
//! [builder]: ./struct.NonBlockingBuilder.html#method.default
//! [builder]: NonBlockingBuilder::default()
//!
//! <br/> This function returns a tuple of `NonBlocking` and `WorkerGuard`.
//! `NonBlocking` implements [`MakeWriter`] which integrates with `tracing_subscriber`.
Expand All @@ -33,7 +33,7 @@
//!
//! See [`WorkerGuard`][worker_guard] for examples of using the guard.
//!
//! [worker_guard]: ./struct.WorkerGuard.html
//! [worker_guard]: WorkerGuard
//!
//! # Examples
//!
Expand Down Expand Up @@ -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;

Expand All @@ -78,7 +78,6 @@ 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
/// 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.
Expand Down Expand Up @@ -135,8 +134,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<T: Write + Send + Sync + 'static>(writer: T) -> (NonBlocking, WorkerGuard) {
NonBlockingBuilder::default().finish(writer)
}
Expand Down Expand Up @@ -170,7 +169,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,
Expand Down
10 changes: 1 addition & 9 deletions tracing-appender/src/rolling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
//! 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
//!
//! # Examples
//!
Expand All @@ -43,7 +39,7 @@ use std::path::Path;
/// blocking the current thread.
///
/// [write]: https://doc.rust-lang.org/nightly/std/io/trait.Write.html
/// [non-blocking]: ../non_blocking/struct.NonBlocking.html
/// [non-blocking]: super::non_blocking::NonBlocking
///
/// # Examples
///
Expand Down Expand Up @@ -73,10 +69,6 @@ impl RollingFileAppender {
/// - [`Rotation::daily()`][daily],
/// - [`Rotation::never()`][never]
///
/// [minutely]: fn.minutely.html
/// [hourly]: fn.hourly.html
/// [daily]: fn.daily.html
/// [never]: fn.never.html
///
/// # Examples
/// ```rust
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 @@ -35,8 +35,8 @@
//! ```
//!
//! [`tracing`]: https://crates.io/crates/tracing
//! [instrument]: macro@instrument
//! [span]: https://docs.rs/tracing/latest/tracing/span/index.html
//! [instrument]: attr.instrument.html
//!
//! ## Supported Rust Versions
//!
Expand Down
4 changes: 0 additions & 4 deletions tracing-core/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ use core::any::{Any, TypeId};
/// [ID]: super::span::Id
/// [`new_span`]: Collect::new_span
/// [`register_callsite`]: Collect::register_callsite
/// [`Interest`]: Interest
/// [`enabled`]: Collect::enabled
/// [`clone_span`]: Collect::clone_span
/// [`try_close`]: Collect::try_close
Expand Down Expand Up @@ -134,7 +133,6 @@ pub trait Collect: 'static {
///
/// [filter]: Self::enabled
/// [metadata]: super::metadata::Metadata
/// [`Interest`]: Interest
/// [`enabled`]: Self::enabled
/// [`rebuild_interest_cache`]: super::callsite::fn.rebuild_interest_cache.html
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest {
Expand Down Expand Up @@ -163,7 +161,6 @@ pub trait Collect: 'static {
///
/// [metadata]: super::metadata::Metadata
/// [interested]: Interest
/// [`Interest::sometimes`]: Interest::sometimes
/// [`register_callsite`]: Self::register_callsite
fn enabled(&self, metadata: &Metadata<'_>) -> bool;

Expand All @@ -188,7 +185,6 @@ pub trait Collect: 'static {
/// level changes.
///
/// [level]: super::Level
/// [`Interest`]: Interest
/// [rebuild]: super::callsite::fn.rebuild_interest_cache.html
fn max_level_hint(&self) -> Option<LevelFilter> {
None
Expand Down
1 change: 0 additions & 1 deletion tracing-core/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ impl Dispatch {
/// initialization of statics.
///
/// [collector]: super::collect::Collect
/// [`Dispatch::new`]: Dispatch::new
/// [`lazy_static`]: https://crates.io/crates/lazy_static
pub fn from_static(collector: &'static (dyn Collect + Send + Sync)) -> Self {
#[cfg(feature = "alloc")]
Expand Down
1 change: 0 additions & 1 deletion tracing-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
//! long as doing so complies with this policy.
//!
//!
//! [`span::Id`]: span::Id
//! [`Event`]: event::Event
//! [`Collect`]: collect::Collect
//! [`Metadata`]: metadata::Metadata
Expand Down
2 changes: 1 addition & 1 deletion tracing-core/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ impl LevelFilter {
/// if it is [`OFF`].
///
/// [`Level`]: super::Level
/// [`OFF`]: #associatedconstant.OFF
/// [`OFF`]: LevelFilter::OFF
pub const fn into_level(self) -> Option<Level> {
self.0
}
Expand Down
1 change: 0 additions & 1 deletion tracing-core/src/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pub struct Record<'a> {
/// - "some", with the current span's [`Id`] and [`Metadata`].
///
/// [the `Collector` considers]: super::collect::Collect::current_span
/// [`Id`]: Id
/// [`Metadata`]: super::metadata::Metadata
#[derive(Debug)]
pub struct Current {
Expand Down
2 changes: 1 addition & 1 deletion tracing-error/src/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ use tracing::{Metadata, Span};
/// [fields]: https://docs.rs/tracing/latest/tracing/field/index.html
/// [futures]: https://doc.rust-lang.org/std/future/trait.Future.html
/// [`tracing-futures`]: https://docs.rs/tracing-futures/
/// [`with_spans`]: #method.with_spans
/// [`with_spans`]: SpanTrace::with_spans()
#[derive(Clone)]
pub struct SpanTrace {
span: Span,
Expand Down
2 changes: 1 addition & 1 deletion tracing-error/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use tracing_subscriber::{
/// provided, the [default format] is used instead.
///
/// [subscriber]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/subscriber/trait.Subscribe.html
/// [`SpanTrace`]: ../struct.SpanTrace.html
/// [`SpanTrace`]: super::SpanTrace
/// [field formatter]: https://docs.rs/tracing-subscriber/0.2.10/tracing_subscriber/fmt/trait.FormatFields.html
/// [default format]: https://docs.rs/tracing-subscriber/0.2.10/tracing_subscriber/fmt/format/struct.DefaultFields.html
pub struct ErrorSubscriber<S, F = DefaultFields> {
Expand Down
8 changes: 1 addition & 7 deletions tracing-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,7 @@
//! }
//! ```
//!
//! [`SpanTrace`]: struct.SpanTrace.html
//! [`ErrorSubscriber`]: struct.ErrorSubscriber.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
//! [`in_current_span()`]: InstrumentResult::in_current_span
//! [span]: https://docs.rs/tracing/latest/tracing/span/index.html
//! [events]: https://docs.rs/tracing/latest/tracing/struct.Event.html
//! [collector]: https://docs.rs/tracing/latest/tracing/trait.Collect.html
Expand Down
5 changes: 1 addition & 4 deletions tracing-flame/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@
//!
//! [`tracing`]: https://docs.rs/tracing
//! [`inferno`]: https://docs.rs/inferno
//! [`FlameLayer`]: struct.FlameLayer.html
//! [`FlushGuard`]: struct.FlushGuard.html
//! [`inferno-flamegraph`]: https://docs.rs/inferno/0.9.5/inferno/index.html#producing-a-flame-graph
//!
//! ## Supported Rust Versions
Expand Down Expand Up @@ -212,8 +210,7 @@ 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.FlameSubscriber.html#method.flush_on_drop
/// [`FlushGuard`]: struct.FlushGuard.html
/// [`flush_on_drop`]: FlameSubscriber::flush_on_drop()
#[derive(Debug)]
pub struct FlameSubscriber<C, W> {
out: Arc<Mutex<W>>,
Expand Down
2 changes: 0 additions & 2 deletions tracing-futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
//! [`tracing`]: https://crates.io/crates/tracing
//! [span]: https://docs.rs/tracing/latest/tracing/span/index.html
//! [collector]: https://docs.rs/tracing/latest/tracing/collect/index.html
//! [`Instrument`]: trait.Instrument.html
//! [`WithCollector`]: trait.WithCollector.html
//! [`futures`]: https://crates.io/crates/futures
//!
//! ## Supported Rust Versions
Expand Down
2 changes: 1 addition & 1 deletion tracing-journald/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! [`tracing-subscriber::Subscriber`][subscriber] implementation for logging `tracing` spans
//! and events to [`systemd-journald`][journald], on Linux distributions that
//! use `systemd`.
//!
//!
//! *Compiler support: [requires `rustc` 1.42+][msrv]*
//!
//! [msrv]: #supported-rust-versions
Expand Down
9 changes: 2 additions & 7 deletions tracing-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,8 @@
//! 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
//! [`env_logger`]: env_logger/index.html
//! [`init`]: LogTracer::init()
//! [`init_with_filter`]: LogTracer::init_with_filter()
//! [`tracing`]: https://crates.io/crates/tracing
//! [`log`]: https://crates.io/crates/log
//! [`env_logger` crate]: https://crates.io/crates/env-logger
Expand Down Expand Up @@ -380,7 +376,6 @@ impl AsTrace for log::Level {
/// regardless of the source of its source.
///
/// [`normalized_metadata`]: trait.NormalizeEvent.html#normalized_metadata
/// [`AsTrace`]: trait.AsTrace.html
/// [`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
Expand Down
18 changes: 8 additions & 10 deletions tracing-log/src/log_tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
//! such as when a crate emits both `tracing` diagnostics _and_ log records by
//! default.
//!
//! [`LogTracer`]: struct.LogTracer.html
//! [`log`]: https://docs.rs/log/0.4.8/log/
//! [logger interface]: https://docs.rs/log/0.4.8/log/trait.Log.html
//! [`init`]: struct.LogTracer.html#method.init.html
//! [`init_with_filter`]: struct.LogTracer.html#method.init_with_filter.html
//! [builder]: struct.LogTracer.html#method.builder
//! [ignore]: struct.Builder.html#method.ignore_crate
//! [`init`]: LogTracer.html#method.init
//! [`init_with_filter`]: LogTracer.html#method.init_with_filter
//! [builder]: LogTracer::builder()
//! [ignore]: Builder::ignore_crate()
use crate::{format_trace, AsTrace};
pub use log::SetLoggerError;
use tracing_core::dispatch;
Expand Down Expand Up @@ -93,7 +92,7 @@ impl LogTracer {
/// # }
/// ```
///
/// [`init`]: #method.init
/// [`init`]: LogTracer::init()
/// [`init_with_filter`]: .#method.init_with_filter
pub fn new() -> Self {
Self {
Expand All @@ -109,7 +108,7 @@ impl LogTracer {
/// The [`builder`] function can be used to customize the `LogTracer` before
/// initializing it.
///
/// [`builder`]: #method.builder
/// [`builder`]: LogTracer::builder()
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn init_with_filter(level: log::LevelFilter) -> Result<(), SetLoggerError> {
Expand Down Expand Up @@ -143,8 +142,8 @@ impl LogTracer {
/// If you know in advance you want to filter some log levels,
/// use [`builder`] or [`init_with_filter`] instead.
///
/// [`init_with_filter`]: #method.init_with_filter
/// [`builder`]: #method.builder
/// [`init_with_filter`]: LogTracer::init_with_filter()
/// [`builder`]: LogTracer::builder()
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn init() -> Result<(), SetLoggerError> {
Expand Down Expand Up @@ -197,7 +196,6 @@ impl log::Log for LogTracer {
impl Builder {
/// Returns a new `Builder` to construct a [`LogTracer`].
///
/// [`LogTracer`]: struct.LogTracer.html
pub fn new() -> Self {
Self::default()
}
Expand Down
5 changes: 2 additions & 3 deletions tracing-opentelemetry/src/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ use opentelemetry::{api, sdk};
/// See the [`OpenTelemetrySpanExt::set_parent`] and
/// [`OpenTelemetrySpanExt::context`] methods for example usage.
///
/// [`OpenTelemetrySpanExt::set_parent`]: crate::OpenTelemetrySpanExt::set_parent
/// [`OpenTelemetrySpanExt::context`]: crate::OpenTelemetrySpanExt::context
/// [`Tracer`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/tracer/trait.Tracer.html
/// [`SpanBuilder`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/tracer/struct.SpanBuilder.html
/// [`SpanContext`]: https://docs.rs/opentelemetry/latest/opentelemetry/api/trace/span_context/struct.SpanContext.html
/// [`PreSampledTracer::sampled_span_context`]: trait.PreSampledTracer.html#tymethod.sampled_span_context
/// [`OpenTelemetrySpanExt::set_parent`]: trait.OpenTelemetrySpanExt.html#tymethod.set_parent
/// [`OpenTelemetrySpanExt::context`]: trait.OpenTelemetrySpanExt.html#tymethod.context
pub trait PreSampledTracer {
/// Produce a pre-sampled span context for the given span builder.
fn sampled_span_context(&self, builder: &mut api::SpanBuilder) -> api::SpanContext;
Expand Down
2 changes: 1 addition & 1 deletion tracing-subscriber/src/field/delimited.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl<D, V> Delimited<D, V> {
/// 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 }
}
Expand Down
2 changes: 1 addition & 1 deletion tracing-subscriber/src/field/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl<V> Messages<V> {
/// 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)
}
Expand Down
Loading