diff --git a/README.md b/README.md index 76e84ec45a..12c287c14a 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ To use `tracing-subscriber`, add the following to your `Cargo.toml`: ```toml [dependencies] tracing = "0.1" -tracing-subscriber = "0.2" +tracing-subscriber = "0.3" ``` Then create and install a `Subscriber`, for example using [`init()`]: diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 6182e8c732..cc422ca4a8 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -15,7 +15,7 @@ tracing-core = { path = "../tracing-core", version = "0.1" } tracing-error = { path = "../tracing-error" } tracing-flame = { path = "../tracing-flame" } tracing-tower = { version = "0.1.0", path = "../tracing-tower" } -tracing-subscriber = { path = "../tracing-subscriber", version = "0.2", features = ["json", "env-filter"] } +tracing-subscriber = { path = "../tracing-subscriber", version = "0.3", features = ["json", "env-filter"] } tracing-futures = { version = "0.2.1", path = "../tracing-futures", features = ["futures-01"] } tracing-attributes = { path = "../tracing-attributes", version = "0.1.2" } tracing-log = { path = "../tracing-log", version = "0.1.1", features = ["env_logger"] } diff --git a/tracing-appender/Cargo.toml b/tracing-appender/Cargo.toml index a4276ab23d..694aa92ef0 100644 --- a/tracing-appender/Cargo.toml +++ b/tracing-appender/Cargo.toml @@ -25,7 +25,7 @@ time = { version = "0.3", default-features = false, features = ["formatting"] } [dependencies.tracing-subscriber] path = "../tracing-subscriber" -version = "0.2.7" +version = "0.3" default-features = false features = ["fmt", "std"] diff --git a/tracing-error/Cargo.toml b/tracing-error/Cargo.toml index eb0962e02a..092b9b0303 100644 --- a/tracing-error/Cargo.toml +++ b/tracing-error/Cargo.toml @@ -38,7 +38,7 @@ default = ["traced-error"] traced-error = [] [dependencies] -tracing-subscriber = { path = "../tracing-subscriber", version = "0.2.19", default-features = false, features = ["registry", "fmt"] } +tracing-subscriber = { path = "../tracing-subscriber", version = "0.3", default-features = false, features = ["registry", "fmt"] } tracing = { path = "../tracing", version = "0.1.12", default-features = false, features = ["std"] } [badges] diff --git a/tracing-error/src/layer.rs b/tracing-error/src/layer.rs index 321a660fda..14c019258a 100644 --- a/tracing-error/src/layer.rs +++ b/tracing-error/src/layer.rs @@ -15,10 +15,10 @@ use tracing_subscriber::{ /// when formatting the fields of each span in a trace. When no formatter is /// provided, the [default format] is used instead. /// -/// [`Layer`]: https://docs.rs/tracing-subscriber/0.2.10/tracing_subscriber/layer/trait.Layer.html +/// [`Layer`]: https://docs.rs/tracing-subscriber/0.3/tracing_subscriber/layer/trait.Layer.html /// [`SpanTrace`]: ../struct.SpanTrace.html -/// [field formatter]: https://docs.rs/tracing-subscriber/0.2.10/tracing_subscriber/fmt/trait.FormatFields.html -/// [default format]: https://docs.rs/tracing-subscriber/0.2.10/tracing_subscriber/fmt/format/struct.DefaultFields.html +/// [field formatter]: https://docs.rs/tracing-subscriber/0.3/tracing_subscriber/fmt/trait.FormatFields.html +/// [default format]: https://docs.rs/tracing-subscriber/0.3/tracing_subscriber/fmt/format/struct.DefaultFields.html pub struct ErrorLayer { format: F, diff --git a/tracing-flame/Cargo.toml b/tracing-flame/Cargo.toml index 36ae88c79b..a55263cebc 100644 --- a/tracing-flame/Cargo.toml +++ b/tracing-flame/Cargo.toml @@ -25,7 +25,7 @@ default = ["smallvec"] smallvec = ["tracing-subscriber/smallvec"] [dependencies] -tracing-subscriber = { path = "../tracing-subscriber", version = "0.2.19", default-features = false, features = ["registry", "fmt"] } +tracing-subscriber = { path = "../tracing-subscriber", version = "0.3", default-features = false, features = ["registry", "fmt"] } tracing = { path = "../tracing", version = "0.1.12", default-features = false, features = ["std"] } lazy_static = "1.3.0" diff --git a/tracing-journald/Cargo.toml b/tracing-journald/Cargo.toml index 905a288266..945738d83e 100644 --- a/tracing-journald/Cargo.toml +++ b/tracing-journald/Cargo.toml @@ -16,4 +16,4 @@ keywords = ["tracing", "journald"] [dependencies] tracing-core = { path = "../tracing-core", version = "0.1.10" } -tracing-subscriber = { path = "../tracing-subscriber", version = "0.2.19" } +tracing-subscriber = { path = "../tracing-subscriber", version = "0.3" } diff --git a/tracing-opentelemetry/Cargo.toml b/tracing-opentelemetry/Cargo.toml index f16e76ed1c..45325de665 100644 --- a/tracing-opentelemetry/Cargo.toml +++ b/tracing-opentelemetry/Cargo.toml @@ -25,7 +25,7 @@ default = ["tracing-log"] opentelemetry = { version = "0.16", default-features = false, features = ["trace"] } tracing = { path = "../tracing", version = "0.1", default-features = false, features = ["std"] } tracing-core = { path = "../tracing-core", version = "0.1" } -tracing-subscriber = { path = "../tracing-subscriber", version = "0.2", default-features = false, features = ["registry", "std"] } +tracing-subscriber = { path = "../tracing-subscriber", version = "0.3", default-features = false, features = ["registry", "std"] } tracing-log = { path = "../tracing-log", version = "0.1", default-features = false, optional = true } [dev-dependencies] diff --git a/tracing-subscriber/CHANGELOG.md b/tracing-subscriber/CHANGELOG.md index 898cbe7277..02be3dee29 100644 --- a/tracing-subscriber/CHANGELOG.md +++ b/tracing-subscriber/CHANGELOG.md @@ -1,3 +1,82 @@ +# 0.3.0 (Oct 22, 2021) + +This is a breaking release of `tracing-subscriber`. The primary breaking change +in this release is the removal of the dependency on the [`chrono` crate], due to +[RUSTSEC-2020-0159]. To replace `chrono`, support is added for formatting +timestamps using the [`time` crate] instead. + +In addition, this release includes a number of other breaking API changes, such +as adding (limited) support for `#![no_std]` targets, removing previously +deprecated APIs, and more. + +### Breaking Changes + +- Removed APIs deprecated in the v0.2.x release series. +- Renamed `Layer::new_span` to `Layer::on_new_span` ([#1674]) +- Removed `Layer` impl for `Arc>` and `Arc + ...>` + ([#1649]) +- Replaced the [`chrono` crate] with the [`time` crate] for timestamp formatting, to + resolve [RUSTSEC-2020-0159] ([#1646]) +- Removed `json` and `env-filter` from default features. They must now be + enabled explictly ([#1647]) +- Changed `FormatEvent::format_event` and `FormatFields::format_fields` + trait methods to take a `Writer` type, rather than a `&mut dyn fmt::Write` + trait object ([#1661]) +- Changed the signature of the `MakeWriter` trait by adding a lifetime parameter + ([#781]) +### Changed + +- **layer**: Renamed `Layer::new_span` to `Layer::on_new_span` ([#1674]) +- **fmt**: Changed `FormatEvent::format_event` and `FormatFields::format_fields` + trait methods to take a `Writer` type, rather than a `&mut dyn fmt::Write` + trait object ([#1661]) +- **json**, **env-filter**: `json` and `env-filter` feature flags are no longer + enabled by default ([#1647]) +### Removed + +- Removed deprecated `CurrentSpan` type ([#1320]) +- **registry**: Removed deprecated `SpanRef::parents` iterator, replaced by + `SpanRef::scope` in [#1431] ([#1648)]) +- **layer**: Removed deprecated `Context::scope` iterator, replaced by + `Context::span_scope` and `Context::event_scope` in [#1431] and [#1434] + ([#1648)]) +- **layer**: Removed `Layer` impl for `Arc>` and + `Arc + ...>`. These interfere with per-layer filtering. ([#1649]) +- **fmt**: Removed deprecated `LayerBuilder` type ([#1673]) +- **fmt**: Removed `fmt::Layer::on_event` (renamed to `fmt::Layer::fmt_event`) + ([#1673]) +- **fmt**, **chrono**: Removed the `chrono` feature flag and APIs for using the + [`chrono` crate] for timestamp formatting ([#1646]) +### Added + +- **fmt**, **time**: `LocalTime` and `UtcTime` types for formatting timestamps + using the [`time` crate] ([#1646]) +- **fmt**: Added a lifetime parameter to the `MakeWriter` trait, allowing it to + return a borrowed writer. This enables implementations of `MakeWriter` for + types such as `Mutex` and `std::fs::File`. ([#781]) +- **env-filter**: Documentation improvements ([#1637]) +- Support for some APIs on `#![no_std]` targets, by disabling the `std` feature + flag ([#1660]) + +Thanks to @Folyd and @nmathewson for contributing to this release! + +[#1320]: https://github.com/tokio-rs/tracing/pull/1320 +[#1673]: https://github.com/tokio-rs/tracing/pull/1673 +[#1674]: https://github.com/tokio-rs/tracing/pull/1674 +[#1646]: https://github.com/tokio-rs/tracing/pull/1646 +[#1647]: https://github.com/tokio-rs/tracing/pull/1647 +[#1648]: https://github.com/tokio-rs/tracing/pull/1648 +[#1649]: https://github.com/tokio-rs/tracing/pull/1649 +[#1660]: https://github.com/tokio-rs/tracing/pull/1660 +[#1661]: https://github.com/tokio-rs/tracing/pull/1661 +[#1431]: https://github.com/tokio-rs/tracing/pull/1431 +[#1434]: https://github.com/tokio-rs/tracing/pull/1434 +[#781]: https://github.com/tokio-rs/tracing/pull/781 + +[`chrono` crate]: https://crates.io/crates/chrono +[`time` crate]: https://crates.io/crates/time +[RUSTSEC-2020-0159]: https://rustsec.org/advisories/RUSTSEC-2020-0159.html + # 0.2.25 (October 5, 2021) This release fixes an issue where a `Layer` implementation's custom diff --git a/tracing-subscriber/Cargo.toml b/tracing-subscriber/Cargo.toml index dcea8dcb82..ff6397aa74 100644 --- a/tracing-subscriber/Cargo.toml +++ b/tracing-subscriber/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tracing-subscriber" -version = "0.2.25" +version = "0.3.0" authors = [ "Eliza Weisman ", "David Barsky ", diff --git a/tracing-subscriber/README.md b/tracing-subscriber/README.md index 2624564739..7b462bad40 100644 --- a/tracing-subscriber/README.md +++ b/tracing-subscriber/README.md @@ -21,7 +21,7 @@ Utilities for implementing and composing [`tracing`][tracing] subscribers. [crates-badge]: https://img.shields.io/crates/v/tracing-subscriber.svg [crates-url]: https://crates.io/crates/tracing-subscriber [docs-badge]: https://docs.rs/tracing-subscriber/badge.svg -[docs-url]: https://docs.rs/tracing-subscriber/0.2.25 +[docs-url]: https://docs.rs/tracing-subscriber/0.3.0 [docs-master-badge]: https://img.shields.io/badge/docs-master-blue [docs-master-url]: https://tracing-rs.netlify.com/tracing_subscriber [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg diff --git a/tracing-subscriber/src/lib.rs b/tracing-subscriber/src/lib.rs index 209045283e..a3f7656477 100644 --- a/tracing-subscriber/src/lib.rs +++ b/tracing-subscriber/src/lib.rs @@ -126,7 +126,7 @@ //! [`parking_lot`]: https://crates.io/crates/parking_lot //! [`time` crate]: https://crates.io/crates/time //! [`liballoc`]: https://doc.rust-lang.org/alloc/index.html -#![doc(html_root_url = "https://docs.rs/tracing-subscriber/0.2.25")] +#![doc(html_root_url = "https://docs.rs/tracing-subscriber/0.3.0")] #![doc( html_logo_url = "https://github.com/raw/tokio-rs/tracing/master/assets/logo-type.png", issue_tracker_base_url = "https://github.com/tokio-rs/tracing/issues/" diff --git a/tracing/README.md b/tracing/README.md index 18ed47e11b..e3ee55b7e3 100644 --- a/tracing/README.md +++ b/tracing/README.md @@ -62,7 +62,7 @@ idiomatic `tracing`.) In order to record trace events, executables have to use a `Subscriber` implementation compatible with `tracing`. A `Subscriber` implements a way of collecting trace data, such as by logging it to standard output. [`tracing_subscriber`](https://docs.rs/tracing-subscriber/)'s -[`fmt` module](https://docs.rs/tracing-subscriber/0.2.0-alpha.2/tracing_subscriber/fmt/index.html) provides reasonable defaults. +[`fmt` module](https://docs.rs/tracing-subscriber/0.3/tracing_subscriber/fmt/index.html) provides reasonable defaults. Additionally, `tracing-subscriber` is able to consume messages emitted by `log`-instrumented libraries and modules. The simplest way to use a subscriber is to call the `set_global_default` function.