-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subscriber: add minimal #![no_std]
support
#1648
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implementing `Subscribe` for `Arc`s, which are immutable, breaks the ability to implement `Subscribe::on_layer` with a mutable reference. This is necessary for per-layer filtering. See #1576 (comment) for details. Therefore, the `Layer` impls for `Arc`s should not be used. In 0.3, we have the opportunity to remove these APIs. Therefore, this PR removes them.
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
hawkw
force-pushed
the
eliza/subscriber-no-std
branch
from
October 19, 2021 17:22
530624a
to
88bbc55
Compare
davidbarsky
approved these changes
Oct 19, 2021
Signed-off-by: Eliza Weisman <[email protected]>
… into eliza/subscriber-no-std
hawkw
commented
Oct 19, 2021
apparently this behaves differently on 1.42.0, so we can't use the macro here... Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
jtescher
approved these changes
Oct 19, 2021
hawkw
added a commit
that referenced
this pull request
Oct 21, 2021
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999 Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Oct 21, 2021
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999 Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Oct 22, 2021
# 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<L: Layer<S>>` and `Arc<dyn Layer<S> + ...>` ([#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<L: Layer<S>>` and `Arc<dyn Layer<S> + ...>`. 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<T: io::Write>` 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]: #1320 [#1673]: #1673 [#1674]: #1674 [#1646]: #1646 [#1647]: #1647 [#1648]: #1648 [#1649]: #1649 [#1660]: #1660 [#1661]: #1661 [#1431]: #1431 [#1434]: #1434 [#781]: #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
hawkw
added a commit
that referenced
this pull request
Oct 22, 2021
# 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<L: Layer<S>>` and `Arc<dyn Layer<S> + ...>` ([#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<L: Layer<S>>` and `Arc<dyn Layer<S> + ...>`. 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<T: io::Write>` 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]: #1320 [#1673]: #1673 [#1674]: #1674 [#1646]: #1646 [#1647]: #1647 [#1648]: #1648 [#1649]: #1649 [#1660]: #1660 [#1661]: #1661 [#1431]: #1431 [#1434]: #1434 [#781]: #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 Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 23, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 23, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Backports #1648 from `master`. Depends on #1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes #999
davidbarsky
pushed a commit
to tokio-rs/tracing-opentelemetry
that referenced
this pull request
Mar 21, 2023
# 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<L: Layer<S>>` and `Arc<dyn Layer<S> + ...>` ([#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<L: Layer<S>>` and `Arc<dyn Layer<S> + ...>`. 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<T: io::Write>` 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]: tokio-rs/tracing#1320 [#1673]: tokio-rs/tracing#1673 [#1674]: tokio-rs/tracing#1674 [#1646]: tokio-rs/tracing#1646 [#1647]: tokio-rs/tracing#1647 [#1648]: tokio-rs/tracing#1648 [#1649]: tokio-rs/tracing#1649 [#1660]: tokio-rs/tracing#1660 [#1661]: tokio-rs/tracing#1661 [#1431]: tokio-rs/tracing#1431 [#1434]: tokio-rs/tracing#1434 [#781]: tokio-rs/tracing#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 Signed-off-by: Eliza Weisman <[email protected]>
kaffarell
pushed a commit
to kaffarell/tracing
that referenced
this pull request
May 22, 2024
Backports tokio-rs#1648 from `master`. Depends on tokio-rs#1649 ## Motivation Presently, the `tracing-subscriber` crate requires the Rust standard library and doesn't build with `#![no_std]` targets. For the most part, this is fine, as much of `tracing-subscriber` inherently depends on `std` APIs. However, `tracing-subscriber` also contains some key abstractions that are necessary for interoperability: the `Layer` and `LookupSpan` traits. Since these traits are in `tracing-subscriber`, `no-std` users cannot currently access them. Some of the other utilities in this crate, such as the field visitor combinators, may also be useful for `#![no_std]` projects. ## Solution This branch adds "std" and "alloc" feature flags to `tracing-subscriber`, for conditionally enabling `libstd` and `liballoc`, respectively. The `registry`, `fmt`, `EnvFilter`, and `reload` APIs all require libstd, and cannot be implemented without it, but the core `Layer` and `LookupSpan` traits are now available with `#![no_std]`. Fixes tokio-rs#999 Signed-off-by: Eliza Weisman <[email protected]>
kaffarell
pushed a commit
to kaffarell/tracing
that referenced
this pull request
May 22, 2024
# 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` ([tokio-rs#1674]) - Removed `Layer` impl for `Arc<L: Layer<S>>` and `Arc<dyn Layer<S> + ...>` ([tokio-rs#1649]) - Replaced the [`chrono` crate] with the [`time` crate] for timestamp formatting, to resolve [RUSTSEC-2020-0159] ([tokio-rs#1646]) - Removed `json` and `env-filter` from default features. They must now be enabled explictly ([tokio-rs#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 ([tokio-rs#1661]) - Changed the signature of the `MakeWriter` trait by adding a lifetime parameter ([tokio-rs#781]) ### Changed - **layer**: Renamed `Layer::new_span` to `Layer::on_new_span` ([tokio-rs#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 ([tokio-rs#1661]) - **json**, **env-filter**: `json` and `env-filter` feature flags are no longer enabled by default ([tokio-rs#1647]) ### Removed - Removed deprecated `CurrentSpan` type ([tokio-rs#1320]) - **registry**: Removed deprecated `SpanRef::parents` iterator, replaced by `SpanRef::scope` in [tokio-rs#1431] ([tokio-rs#1648)]) - **layer**: Removed deprecated `Context::scope` iterator, replaced by `Context::span_scope` and `Context::event_scope` in [tokio-rs#1431] and [tokio-rs#1434] ([tokio-rs#1648)]) - **layer**: Removed `Layer` impl for `Arc<L: Layer<S>>` and `Arc<dyn Layer<S> + ...>`. These interfere with per-layer filtering. ([tokio-rs#1649]) - **fmt**: Removed deprecated `LayerBuilder` type ([tokio-rs#1673]) - **fmt**: Removed `fmt::Layer::on_event` (renamed to `fmt::Layer::fmt_event`) ([tokio-rs#1673]) - **fmt**, **chrono**: Removed the `chrono` feature flag and APIs for using the [`chrono` crate] for timestamp formatting ([tokio-rs#1646]) ### Added - **fmt**, **time**: `LocalTime` and `UtcTime` types for formatting timestamps using the [`time` crate] ([tokio-rs#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<T: io::Write>` and `std::fs::File`. ([tokio-rs#781]) - **env-filter**: Documentation improvements ([tokio-rs#1637]) - Support for some APIs on `#![no_std]` targets, by disabling the `std` feature flag ([tokio-rs#1660]) Thanks to @Folyd and @nmathewson for contributing to this release! [tokio-rs#1320]: tokio-rs#1320 [tokio-rs#1673]: tokio-rs#1673 [tokio-rs#1674]: tokio-rs#1674 [tokio-rs#1646]: tokio-rs#1646 [tokio-rs#1647]: tokio-rs#1647 [tokio-rs#1648]: tokio-rs#1648 [tokio-rs#1649]: tokio-rs#1649 [tokio-rs#1660]: tokio-rs#1660 [tokio-rs#1661]: tokio-rs#1661 [tokio-rs#1431]: tokio-rs#1431 [tokio-rs#1434]: tokio-rs#1434 [tokio-rs#781]: tokio-rs#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 Signed-off-by: Eliza Weisman <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #1649
Motivation
Presently, the
tracing-subscriber
crate requires the Rust standardlibrary and doesn't build with
#![no_std]
targets. For the most part,this is fine, as much of
tracing-subscriber
inherently depends onstd
APIs.However,
tracing-subscriber
also contains some key abstractions thatare necessary for interoperability: the
Subscriber
andLookupSpan
traits. Since these traits are in
tracing-subscriber
,no-std
userscannot currently access them.
Some of the other utilities in this crate, such as the field visitor
combinators, may also be useful for
#![no_std]
projects.Solution
This branch adds "std" and "alloc" feature flags to
tracing-subscriber
, for conditionally enablinglibstd
andliballoc
, respectively. Theregistry
,fmt
,EnvFilter
, andreload
APIs all require libstd, and cannot be implemented without it,but the core
Subscribe
andLookupSpan
traits are now available with#![no_std]
.Fixes #999