ValueSets of any length (#2508)This release of tracing-core fixes a bug that caused threads which call dispatcher::get_default before a global default subscriber is set to never see the global default once it is set. In addition, it includes improvements for instrumentation performance in some cases, especially when using a global default dispatcher.
Dispatch::none if dispatcher::get_default is called before dispatcher::set_global_default (#2593)Dispatch that points at a global default subscriber no longer requires an Arc reference count increment, improving performance substantially (#2593)dispatcher::get_default no longer attempts to access a thread local if the scoped dispatcher is not in use, improving performance when the default dispatcher is global (#2593)#[inline] annotations called by the event! and span! macros to reduce the size of macro-generated code and improve recording performance (#2555)Thanks to new contributor @ldm0 for contributing to this release!
This release of tracing-core adds a new on_register_dispatch method to the Subscriber trait to allow the Subscriber to perform initialization after being registered as a Dispatch, and a WeakDispatch type to allow a Subscriber to store its own Dispatch without creating reference count cycles.
Subscriber::on_register_dispatch method (#2269)WeakDispatch type and Dispatch::downgrade() function (#2293)Thanks to @jswrenn for contributing to this release!
This release of tracing-core adds PartialEq and Eq implementations for metadata types, and improves error messages when setting the global default subscriber fails.
PartialEq and Eq implementations for Metadata (#2229)PartialEq and Eq implementations for FieldSet (#2229)fmt::Debug output for dispatcher::SetGlobalDefaultError (#2250)-Z minimal-versions (#2246)Thanks to @jswrenn and @CAD97 for contributing to this release!
This release of tracing-core adds new Value implementations, including one for String, to allow recording &String as a value without having to call as_str() or similar, and for 128-bit integers (i128 and u128). In addition, it adds new methods and trait implementations for Subscribers.
Value implementation for String (#2164)Value implementation for u128 and i28 (#2166)downcast_ref and is methods for dyn Subscriber + Sync, dyn Subscriber + Send, and dyn Subscriber + Send + Sync (#2160)Subscriber::event_enabled method to enable filtering based on Event field values (#2008)Subscriber implementation for Box<S: Subscriber + ?Sized> and Arc<S: Subscriber + ?Sized> (#2161)Thanks to @jswrenn and @CAD97 for contributing to this release!
This release of tracing-core introduces a new DefaultCallsite type, which can be used by instrumentation crates rather than implementing their own callsite types. Using DefaultCallsite may offer reduced overhead from callsite registration.
DefaultCallsite, a pre-written Callsite implementation for use in instrumentation crates (#2083)ValueSet::len and Record::len methods returning the number of fields in a ValueSet or Record (#2152)lazy_static dependency with once_cell (#2147)Thanks to new contributors @jamesmunns and @james7132 for contributing to this release!
This release adds a Value implementation for Box<T: Value> to allow recording boxed values more conveniently. In particular, this should improve the ergonomics of the implementations for dyn std::error::Error trait objects, including those added in v0.1.25.
Value implementation for Box<T> where T: Value (#2071)Thanks to new contributor @ben0x539 for contributing to this release!
This release adds additional Value implementations for std::error::Error trait objects with auto trait bounds (Send and Sync), as Rust will not auto-coerce trait objects. Additionally, it fixes a bug when setting scoped dispatchers that was introduced in the previous release (v0.1.24).
Value implementations for dyn Error + Send + 'static, dyn Error + Send + Sync + 'static, dyn Error + Sync + 'static (#2066)Thanks to @lilyball for contributing to this release!
This release fixes a bug where setting NoSubscriber as the local default would not disable the global default subscriber locally.
NoSubscriber as the local default now correctly disables the global default subscriber (#2001)write! and format_args! macros (#1988)#[inline] attributes from some Dispatch methods whose callers are now inlined (#1974)This release adds experimental support for recording structured field values using the valuable crate. See this blog post for details on valuable.
Note that valuable support currently requires --cfg tracing_unstable. See the documentation for details.
valuable crate (#1608, #1888, #1887)ValueSet::record method (#1823)Default impl for NoSubscriber (#1785)Kind::HINT to support the enabled! macro in tracing (#1883, #1891)Thanks to @xd009642, @Skepfyr, @guswynn, @Folyd, and @mbergkvist for contributing to this release!
This release adds support for recording Option<T> where T: Value as typed tracing field values.
Value impl for Option<T> where T: Value (#1585)default-features disabled (#1603, #1606)Thanks to @brianburgers, @DCjanus, and @matklad for contributing to this release!
This release adds support for f64 as one of the tracing-core primitive field values, allowing floating-point values to be recorded as typed values rather than with fmt::Debug. Additionally, it adds NoSubscriber, a Subscriber implementation that does nothing.
NoSubscriber, a no-op Subscriber implementation (#1549)Visit::record_f64 and support for recording floating-point values (#1507)Thanks to new contributors @jsgf and @maxburke for contributing to this release!
Level::as_str (#1413)Hash implementation for Level and LevelFilter (#1456)Value implementation for &mut T where T: Value (#1385)Thanks to @Folyd, @teozkr, and @dvdplm for contributing to this release!
Subscriber impl for Box<dyn Subscriber + Send + Sync + 'static> (#1358)Subscriber impl for Arc<dyn Subscriber + Send + Sync + 'static> (#1374)From impls for existing Into impls on Current and Option<Id> (#1335)Attributes::fields accessor that returns the set of fields defined on a span's Attributes (#1331)Thanks to @Folyd for contributing to this release!
Event::dispatch and Event::child_of, which could result in dispatcher::get_default being inlined at the callsite (#994)Copy implementations for Level and LevelFilter (#992)Thanks to new contributors @jyn514 and @TaKO8Ki for contributing to this release!
Option<Level> to LevelFilter. This resolves a previously unreported regression where Option<Level> was no longer a valid LevelFilter. (#966)Interest from multiple subscribers, if the interests differ, the current subscriber is now always asked if a callsite should be enabled (#927)tracing crate (#943)fmt::Display impl for field::DisplayValue causing a compilation failure when the “log” feature is enabled (#887)Thanks to @d-e-s-o for contributing to this release!
LevelFilter type and LevelFilter::current() for returning the highest level that any subscriber will enable (#853)Subscriber::max_level_hint optional trait method, for setting the value returned by LevelFilter::current() (#853)Thanks to new contributor @dignati for contributing to this release!
inner_local_macros with $crate:: (#729)must_use warning to guards returned by dispatcher::set_default (#686)fmt::Debug impl to dyn Values (#696)span::Id and NonZeroU64 (#770)tracing-core/std feature is enabled but tracing/std is not (#760)callsite::Identifier (#749)Thanks to @bkchr, @majecty, @taiki-e, @nagisa, and @nvzqz for contributing to this release!
field::Empty type for declaring empty fields whose values will be recorded later (#548)field::Value implementations for Wrapping and NonZero* numbers (#538)Thanks to @oli-cosmian for contributing to this release!
dispatcher::with_default as it is being dropped (#522)Subscriber::drop_span (#524)Default impl for Dispatch (#411)lazy_static dependencies (#424)std feature flag is set (#424)Metadata in Event docs (#461)dispatcher::set_default API which returns a drop guard (#388)Value impl for u8 (#392)field::display documentation (#340)std::error::Error as a new primitive Value type (#277)Event::new and Event::new_child_of to manually construct Events (#281)no-std + liballoc (#256)std::fmt::Display implementation for Level (#194)std::str::FromStr implementation for Level (#195)Subscriber::drop_span in favor of new Subscriber::try_close (#168)Into<Option<&Id>>, Into<Option<Id>>, and Into<Option<&'static Metadata<'static>>> impls for span::Current (#170)Subscriber::try_close method (#153)dispatcher (#171)Subscriber::current_span API to return the current span (#148).span::Current type, representing the Subscriber's view of the current span (#148).