Skip to content

tracing: update tracing-subscriber to v0.3.x #1327

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

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1547,9 +1547,9 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4"

[[package]]
name = "matchers"
version = "0.0.1"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1"
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
dependencies = [
"regex-automata",
]
Expand Down Expand Up @@ -2388,9 +2388,9 @@ dependencies = [

[[package]]
name = "tracing-subscriber"
version = "0.2.25"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71"
checksum = "5cf865b5ddc38e503a29c41c4843e616a73028ae18c637bc3eb2afaef4909c84"
dependencies = [
"ansi_term",
"lazy_static",
Expand Down
2 changes: 1 addition & 1 deletion linkerd/app/integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ tower = { version = "0.4.10", default-features = false }
tonic = { version = "0.5", default-features = false }
tracing = "0.1.29"
webpki = "0.21"
tracing-subscriber = { version = "0.2", default-features = false, features = ["fmt"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "std"] }

[dev-dependencies]
flate2 = { version = "1.0.22", default-features = false, features = ["rust_backend"] }
Expand Down
2 changes: 1 addition & 1 deletion linkerd/app/test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ tokio-test = "0.4"
tokio-stream = { version = "0.1.7", features = ["sync"] }
tower = { version = "0.4.10", default-features = false}
tracing = "0.1.29"
tracing-subscriber = { version = "0.2.25", features = ["env-filter", "fmt"], default-features = false }
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt", "std"], default-features = false }
thiserror = "1"
5 changes: 2 additions & 3 deletions linkerd/tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ tracing = "0.1.29"
tracing-log = "0.1.2"

[dependencies.tracing-subscriber]
version = "0.2.25"
default-features = false
features = ["env-filter", "fmt", "smallvec", "tracing-log", "json", "parking_lot"]
version = "0.3"
features = ["env-filter","smallvec", "tracing-log", "json", "parking_lot"]

7 changes: 4 additions & 3 deletions linkerd/tracing/src/uptime.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::fmt;
use tokio::time::{Duration, Instant};
use tracing_subscriber::fmt::{format, time::FormatTime};

pub(crate) struct Uptime {
start_time: Instant,
Expand All @@ -12,14 +13,14 @@ impl Uptime {
}
}

fn format(d: Duration, w: &mut dyn fmt::Write) -> fmt::Result {
fn format(d: Duration, w: &mut impl fmt::Write) -> fmt::Result {
let micros = d.subsec_micros();
write!(w, "[{:>6}.{:06}s]", d.as_secs(), micros)
}
}

impl tracing_subscriber::fmt::time::FormatTime for Uptime {
fn format_time(&self, w: &mut dyn fmt::Write) -> fmt::Result {
impl FormatTime for Uptime {
fn format_time(&self, w: &mut format::Writer<'_>) -> fmt::Result {
Self::format(Instant::now() - self.start_time, w)
}
}
Expand Down