tracing icon indicating copy to clipboard operation
tracing copied to clipboard

add must_use for CollectorBuilder::finish

Open kartva opened this issue 1 year ago • 0 comments

Motivation

Follow up to #2239 Discovered that

    tracing_subscriber::fmt().with_ansi(false).finish();
    tracing::info!("hello");

doesn't actually do anything, because finish returns a Collector and init is the thing that actually installs the collector.

Solution

Added #[must_use] which suggests using try_init instead.

kartva avatar Aug 09 '22 08:08 kartva