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 Span
s 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 interchangably with the versions in tracing-core
and tracing-subscriber
(#853)LevelFilter
s and Level
s (#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 fn
s 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).