This release introduces the Filter trait, a new API for per-layer
filtering. This allows controlling which spans and events are
recorded by various layers individually, rather than globally.
In addition, it adds a new Targets filter, which provides a
lighter-weight version of the filtering provided by EnvFilter, as
well as other smaller API improvements and fixes.
Deprecated
- registry:
SpanRef::parent_id, which cannot properly support
per-layer filtering. Use.parent().map(SpanRef::id)instead.
(#1523)
Fixed
- layer
Contextmethods that are provided when theSubscriber
implementsLookupSpanno longer require the "registry" feature flag
(#1525) - layer
fmt::Debugimplementation forLayeredno longer requires
theStype parameter to implementDebug(#1528)
Added
- registry:
Filtertrait,Filteredtype,Layer::with_filter
method, and other APIs for per-layer filtering (#1523) - filter:
FilterFnandDynFilterFntypes that implement global
(Layer) and per-layer (Filter) filtering for closures and function
pointers (#1523) - filter:
Targetsfilter, which implements a lighter-weight form
ofEnvFilter-like filtering (#1550) - env-filter: Added support for filtering on floating-point values
(#1507) - layer:
Layer::on_layercallback, called when layering the
Layeronto aSubscriber(#1523) - layer:
Layerimplementations forBox<L>andArc<L>whereL: Layer(#1536) - layer:
Layerimplementations forBox<dyn Layer>and
Arc<dyn Layer>(#1536) - A number of small documentation fixes and improvements (#1553,
#1544, #1539, #1524)
Special thanks to new contributors @jsgf and @maxburke for contributing
to this release!