Skip to content

Upgrading tracing-subscriber 0.2 to 0.3

Breaking0.2.25 → 0.3.23Breaking15Security2Platform5Deprecated1New36Changed22Fixed27Other17

BreakingUpgrade verdict

14 breaking changes and 5 platform requirement changes and 2 security fixes.

  • Implementations of the Layer trait must rename the new_span method to on_new_span.
  • Timestamps are now formatted with the time crate instead of chrono.
  • RUST_LOG-based filtering stops working unless the env-filter feature is turned on.
  • chrono-based timestamp formatting is gone; use the time crate instead.
Top 5 of 22 that need code or config changes

Requires Rust 1.65.0 from 0.3.20 (none stated before).

Breaking14
Renames Layer::new_span to Layer::on_new_span.
Layer::new_spanLayer::on_new_span
Replaces the chrono crate with the time crate for timestamp formatting to resolve RUSTSEC-2020-0159.
chronotime
Removes json and env-filter from default features; they must now be enabled explicitly.
jsonenv-filterRUST_LOG
Removes the chrono feature flag and the APIs for formatting timestamps with the chrono crate.
chrono
Removes APIs that were deprecated in the v0.2.x release series.
Removes the Layer impl for Arc<L: Layer<S>> and Arc<dyn Layer<S> + ...>.
LayerArc
Changes FormatEvent::format_event and FormatFields::format_fields to take a Writer type instead of &mut dyn fmt::Write.
FormatEvent::format_eventFormatFields::format_fieldsWriter
Adds a lifetime parameter to the MakeWriter trait signature.
MakeWriter
Removes the deprecated CurrentSpan type.
CurrentSpan
Removes the deprecated SpanRef::parents iterator, replaced by SpanRef::scope.
SpanRef::parentsSpanRef::scope
Removes the deprecated Context::scope iterator, replaced by Context::span_scope and Context::event_scope.
Context::scopeContext::span_scopeContext::event_scope
Removes fmt::Layer::on_event, renamed to fmt::Layer::fmt_event.
fmt::Layer::on_eventfmt::Layer::fmt_event
Removes support for some APIs on #![no_std] targets by disabling the std feature flag.
std
Removes the deprecated LayerBuilder type.
LayerBuilder
Security2
Logging user input may result in poisoning logs with ANSI escape sequences
Updates thread-local to v1.1.4, fixing warnings for security advisory RUSTSEC-2022-0006.
thread-local
Platform5
Increased minimum supported Rust version (MSRV) to 1.63.0+.
Increases the minimum supported Rust version to 1.50+ when the ansi feature flag is enabled.
ansi
Updates the minimum supported Rust version (MSRV) to 1.49.0.
Bumps the minimum supported Rust version (MSRV) to 1.63.
Bump MSRV to 1.63 ().
Deprecated1
Deprecates Pretty::with_source_location in favor of the more general Format, SubscriberBuilder, and Layer methods.
Pretty::with_source_locationFormatSubscriberBuilderLayer