From 02b6731350868a0078bb8831c768f76a9bd1ebd0 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Wed, 27 Jan 2021 23:16:07 +0100 Subject: [PATCH] Only pull in tracing when necessary (#551) Fixes https://github.com/tower-rs/tower/issues/549 Tested with `cargo hack check --each-feature --no-dev-deps` --- tower/CHANGELOG.md | 1 + tower/Cargo.toml | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tower/CHANGELOG.md b/tower/CHANGELOG.md index 7257ff07..d7b1ceca 100644 --- a/tower/CHANGELOG.md +++ b/tower/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased - **util**: Add `ServiceExt::map_future`. ([#542]) +- `tracing` is now only pulled in for the features that need it. [#542]: https://github.com/tower-rs/tower/pull/542 diff --git a/tower/Cargo.toml b/tower/Cargo.toml index 1711d6ed..23871e82 100644 --- a/tower/Cargo.toml +++ b/tower/Cargo.toml @@ -45,16 +45,16 @@ full = [ ] log = ["tracing/log"] balance = ["discover", "load", "ready-cache", "make", "rand", "slab", "tokio-stream"] -buffer = ["tokio/sync", "tokio/rt", "tokio-stream"] +buffer = ["tokio/sync", "tokio/rt", "tokio-stream", "tracing"] discover = [] filter = ["futures-util"] -hedge = ["util", "filter", "futures-util", "hdrhistogram", "tokio/time"] -limit = ["tokio/time", "tokio/sync"] -load = ["tokio/time"] +hedge = ["util", "filter", "futures-util", "hdrhistogram", "tokio/time", "tracing"] +limit = ["tokio/time", "tokio/sync", "tracing"] +load = ["tokio/time", "tracing"] load-shed = [] make = ["tokio/io-std"] -ready-cache = ["futures-util", "indexmap", "tokio/sync"] -reconnect = ["make", "tokio/io-std"] +ready-cache = ["futures-util", "indexmap", "tokio/sync", "tracing"] +reconnect = ["make", "tokio/io-std", "tracing"] retry = ["tokio/time"] spawn-ready = ["futures-util", "tokio/sync", "tokio/rt", "util"] steer = ["futures-util"] @@ -66,7 +66,6 @@ futures-core = "0.3" pin-project = "1" tower-layer = { version = "0.3.1", path = "../tower-layer" } tower-service = { version = "0.3" } -tracing = "0.1.2" futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true } hdrhistogram = { version = "6.0", optional = true } @@ -75,6 +74,7 @@ rand = { version = "0.8", features = ["small_rng"], optional = true } slab = { version = "0.4", optional = true } tokio = { version = "1", optional = true, features = ["sync"] } tokio-stream = { version = "0.1.0", optional = true } +tracing = { version = "0.1.2", optional = true } [dev-dependencies] futures = "0.3"