This release updates the tracing-core dependency to v0.1.33 and the tracing-attributes dependency to v0.1.28.
register_callsite error (#2938)target and name (#2941)This release fixes a potential stack use-after-free in the Instrument::into_inner method. Only uses of this method are affected by this bug.
mem::ManuallyDrop instead of mem::forget in Instrument::into_inner (#2765)Thanks to @cramertj and @manishearth for finding and fixing this issue!
This release adds several additional features to the tracing macros. In addition, it updates the tracing-core dependency to v0.1.32 and the tracing-attributes dependency to v0.1.27.
ValueSets of any length (#2508)tracing-attributes: updated to 0.1.27tracing-core: updated to 0.1.32clippy::let_with_type_underscore] in macro-generated code ([#2609])unknown_lints in macro-generated code (#2626)#[instrument] when the "log" feature is enabled (#2599)axum-insights to relevant crates. (#2713)clippy-tracing to related crates (#2628)tracing-cloudwatch to related crates (#2667)tracing-etw repo (#2602)This tracing release changes the Drop implementation for Instrumented Futures so that the attached Span is entered when dropping the Future. This means that events emitted by the Future‘s Drop implementation will now be recorded within its Span. It also adds #[inline] hints to methods called in the event! macro’s expansion, for an improvement in both binary size and performance.
Additionally, this release updates the tracing-attributes dependency to v0.1.24, which updates the syn dependency to v2.x.x. tracing-attributes v0.1.24 also includes improvements to the #[instrument] macro; see the tracing-attributes 0.1.24 release notes for details.
Instrumented futures will now enter the attached Span in their Drop implementation, allowing events emitted when dropping the future to occur within the span ([#2562])#[inline] attributes for methods called by the event! macros, making generated code smaller (#2555)level argument to #[instrument(err)] and #[instrument(ret)] to override the level of the generated return value event (#2335)#[instrument] is added to a const fn (#2418)tracing-attributes: updated to 0.1.24cfg-if dependency (#2553)syn dependency to 2.0 (#2516)clippy::unreachable warnings in #[instrument]-generated code (#2356)syn dependency (#2530)#[instrument(err)] (#2433)#[instrument] (#2350)Thanks to @nitnelave, @jsgf, @Abhicodes-crypto, @LukeMathWalker, @andrewpollack, @quad, @klensy, @davidpdrsn, @dbidwell94, @ldm0, @NobodyXu, @ilsv, and @daxpedda for contributing to this release!
This release of tracing incorporates changes from tracing-core v0.1.30 and tracing-attributes v0.1.23, including the new Subscriber::on_register_dispatch method for performing late initialization after a Subscriber is registered as a Dispatch, and bugfixes for the #[instrument] attribute. Additionally, it fixes instances of the bare_trait_objects lint, which is now a warning on tracing's MSRV and will become an error in the next edition.
#[instrument]ed functions (#2307)#[instrument]ed async fns (#2270)syn dependency to fix compilation with -Z minimal-versions (#2246)bare_trait_objects warning in valueset! macro expansion (#2308)Subscriber::on_register_dispatch method (#2269)WeakDispatch type and Dispatch::downgrade() function (#2293)tracing-web and reqwest-tracing to related crates (#2283, #2331)Thanks to new contributors @compiler-errors, @e-nomem, @WorldSEnder, @Xiami2012, and @tl-rodrigo-gryzinski, as well as @jswrenn and @CAD97, for contributing to this release!
This release adds support for owned values and fat pointers as arguments to the Span::record method, as well as updating the minimum tracing-core version and several documentation improvements.
Span::record (#2212)tracing-core: updated to 0.1.29Thanks to @fredr, @cgbur, @jyn514, @matklad, and @CAD97 for contributing to this release!
This release reduces the overhead of callsite registration by using new tracing-core APIs.
DefaultCallsite to reduce callsite registration overhead ([#2083])tracing-core: updated to 0.1.27This release includes bug fixes for the “log” support feature and for the use of both scoped and global default dispatchers in the same program.
async block/fn futures becoming !Send when the “log” feature flag is enabled (#2073)Thanks to @ben0x539 for contributing to this release!
This release adds new span_enabled! and event_enabled! variants of the enabled! macro, for testing whether a subscriber would specifically enable a span or an event.
wasm32) (#2060)Thanks to @guswynn, @arifd, @hrxi, @CAD97, and @name1e5s for contributing to this release!
This release reduces the overhead of creating and dropping disabled spans significantly, which should improve performance when no tracing subscriber is in use or when spans are disabled by a filter.
--minimal-versions due to a too-permissive syn dependency (#1960)This release increases the minimum supported Rust version (MSRV) to 1.49.0. In addition, it fixes some relatively rare macro bugs.
tracing-forest to the list of related crates (#1935)warn! macro incorrectly generating an event with the TRACE level (#1930)concat! macro, for real this time (#1918)Thanks to @QnnOkabayashi, @nicolaasg, and @teohhanhui for contributing to this release!
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.
This release also adds a new enabled! macro for testing if a span or event would be enabled.
valuable crate (#1608, #1888, #1887)enabled! macro for testing if a span or event is enabled (#1882)concat! macro (#1842)Thanks to @@Vlad-Scherbina, @Skepfyr, @Swatinem, @guswynn, @teohhanhui, @xd009642, @tobz, @d-e-s-o@0b01, and @nickelc for contributing to this release!
This release adds support for recording Option<T> where T: Value as typed tracing field values. It also includes significant performance improvements for functions annotated with the #[instrument] attribute when the generated span is disabled.
tracing-core: updated to v0.1.21tracing-attributes: updated to v0.1.18Value impl for Option<T> where T: Value (#1585)#[instrument]-generated spans below the max level (#1600, #1605, #1614, #1616, #1617)Future implementation for WithSubscriber, making the WithDispatch extension trait actually useable (#1602)Thanks to @brianburgers, @mattiast, @DCjanus, @oli-obk, and @matklad for contributing to this release!
This release fixes an issue where the RustDoc documentation was rendered incorrectly. It doesn't include any actual code changes, and is very boring and can be ignored.
<div> tag (#1572)This release adds a new Span::or_current method to aid in efficiently propagating span contexts to spawned threads or tasks. Additionally, it updates the tracing-core version to 0.1.20 and the tracing-attributes version to 0.1.16, ensuring that a number of new features in those crates are present.
WithSubscriber implementations for futures and other types (#1424)Span::or_current method, to help with efficient span context propagation (#1538)skip_all option to #[instrument] (#1548)fmt::Debug (#1378)NoSubscriber, a no-op Subscriber implementation ([#1549])Visit::record_f64 and support for recording floating-point values (#1507, #1522)Thanks to new contributors @dzvon and @mbergkvist, as well as @teozkr, @maxburke, @LukeMathWalker, and @jsgf, for contributing to this release!
#[instrument] and async-trait v0.1.43 and newer ([#1228])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 span::Current, Span, and Option<Id> (#1335, #1338)From<EnteredSpan> implementation for Option<Id>, allowing EnteredSpan to be used in a span! macro's parent: field (#1325)Attributes::fields accessor that returns the set of fields defined on a span's Attributes (#1331)Thanks to @Folyd, @nightmared, and new contributors @rmsc and @Fishrock123 for contributing to this release!
Span::entered method for entering a span and moving it into a guard by value rather than borrowing it (#1252)Thanks to @matklad for contributing to this release!
#[instrument(err)] on functions which return impl Trait (#1236)Thanks to @bkchr and @lfranke for contributing to this release!
#[instrument(err)] on functions with mutable parameters (#1167)#[instrument] with async-trait (#977)syn features ([#928])tracing macros would generate code for events whose levels are disabled statically by the log crate's static_max_level_XXX features (#1175)tracing-futures dependency is no longer required when using #[instrument] on async functions (#808)tracing-attributes minimum dependency to v0.1.12 (#1222)Thanks to @nagisa, @Txuritan, @TaKO8Ki, @okready, and @krojew for contributing to this release!
pin-project-lite dependency to 0.2 (#1108)Span::new, Span::new_root, and Span::new_child_of, which could result in dispatcher::get_default being inlined at the callsite (#994)tracing-core to 0.1.17 (#992)Instrument trait and Instrumented type for attaching a Span to a Future (#808)Copy implementations for Level and LevelFilter (#992)Thanks to @nagisa, and new contributors @SecurityInsanity, @froydnj, @jyn514 and @TaKO8Ki for contributing to this release!
tracing-core to 0.1.15 (#943)tracing-core to fix incorrect calculation of the global max level filter (#908)self in field expressions when instrumenting async-trait functions (#875)Thanks to @anton-dutov, @nightmared, @mystor, and @toshokan for contributing to this release!
LevelFilter::OFF (and thus also the static_max_level_off feature flag) would enable all traces, rather than none (#853)tracing macros and Spans not checking log::max_level before emitting log records (#870)LevelFilter::current) before the per-callsite cache when determining if a span or event is enabled. This significantly improves performance in some use cases (#853)rustc optimizatation of surrounding code (#869, #869)static_max_level_XXX feature flag (#868)LevelFilter is now a re-export of the tracing_core::LevelFilter type, it can now be used interchangeably with the versions in tracing-core and tracing-subscriber (#853)LevelFilters and Levels (#853)tracing-core dependency to 0.1.12 (#853)LevelFilter::current() function, which returns 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 contributors @cuviper, @ethanboxx, @ben0x539, @dignati, @colelawrence, and @rbtcollins for helping out with this release!
Trace log filter, to guard against log users enabling them by default with blanket level filtering (#833)tracing::field::debug and tracing::field::display functions inside the macros when the “log” feature is enabled (#835)#[instrument] (#672)#[instrument] now emits a compiler warning when ignoring unrecognized input (#672, #786)tracing in async code (#769)tracing-core dependency to 0.1.11log or log-always features are enabled (#753)tracing-core/std feature is enabled but tracing/std is not (#760)Thanks to @nagisa for contributing to this release!
local_inner_macros with $crate:: (#740)Thanks to @bnjjj, @blaenk, and @LukeMathWalker for contributing to this release!
log compatibility feature alongside a tracing Subscriber, log records for spans now include span IDs (#613)#[instrument] on methods that are part of async-trait trait implementations (#711)#[instrument(err)] argument to automatically emit an event if an instrumented function returns Err (#637)#[must_use] attribute to the guard returned by subscriber::set_default (#685)log records emitted by spans much less noisy when span IDs are not available (#613)Thanks to @FintanH, @shepmaster, @inanna-malick, @zekisharif, @bkchr, @majecty, @ilana and @nightmared 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)#[instrument] (#569)#[instrument] now emits a helpful compiler error when attempting to skip a function parameter (#600)#[instrument] attribute was placed under an on-by-default feature flag “attributes” (#603)Thanks to @oli-cosmian and @Kobzol for contributing to this release!
Span::with_subscriber method to access the subscriber that tracks a Span (#503)Span::is_none method (#475)LevelFilter::into_level method (#470)LevelFilter::from_level function and From<Level> impl (#471)Span::follows_from that made it impossible to call (#467)log records generated when enabling the log feature flag (#484)#[instrument]ed functions (#397)self parameters when #[instrument]ing methods (#397)skip argument to #[instrument] for excluding function parameters from generated spans (#359)dispatcher::set_default and subscriber::set_default APIs, which return a drop guard (#388)#[instrument]ed async functions not compiling on nightly-2019-09-11 or newer (#342)Subscriber is not in use (#326)log feature will now only cause tracing spans and events to emit log records when a Subscriber is not in use (#346)#[instrument] (#330)log-always feature flag to emit log records even when a Subscriber is set (#346)ansi_term and humantime crates, which were used only for examples (#316)log feature flag is enabled (#304)std::error::Error as a new primitive type (#277)format_args messages without curly braces as delimiters (#288)tracing-core dependency to 0.1.5 (#294)tracing-attributes dependency to 0.1.2 (#297)no-std + liballoc (#263)#[instrument] attribute on async fns no longer requires a feature flag (#258)#[instrument] macro now works on generic functions (#262)#[instrument] attribute for automatically adding spans to functions (#253)log feature flag is enabled (#180).tracing-core minimum dependency version to 0.1.2 (#174).tracing-core APIs (#174).Span::none() constructor, which does not require metadata and returns a completely empty span (#147).Span::current() function, returning the current span if it is known to the subscriber (#148).tracing:: (#152).cfg_if dependency to 0.1.9.log feature is enabled (#131).