util: switch tokio-util from log to tracing (#4539)

This commit is contained in:
Gus Wynn
2022-02-26 12:47:04 +01:00
committed by GitHub
parent ac69d37302
commit 413c812ac8
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ full = ["codec", "compat", "io-util", "time", "net", "rt"]
net = ["tokio/net"] net = ["tokio/net"]
compat = ["futures-io",] compat = ["futures-io",]
codec = [] codec = ["tracing"]
time = ["tokio/time","slab"] time = ["tokio/time","slab"]
io = [] io = []
io-util = ["io", "tokio/rt", "tokio/io-util"] io-util = ["io", "tokio/rt", "tokio/io-util"]
@@ -41,9 +41,9 @@ futures-core = "0.3.0"
futures-sink = "0.3.0" futures-sink = "0.3.0"
futures-io = { version = "0.3.0", optional = true } futures-io = { version = "0.3.0", optional = true }
futures-util = { version = "0.3.0", optional = true } futures-util = { version = "0.3.0", optional = true }
log = "0.4"
pin-project-lite = "0.2.0" pin-project-lite = "0.2.0"
slab = { version = "0.4.4", optional = true } # Backs `DelayQueue` slab = { version = "0.4.4", optional = true } # Backs `DelayQueue`
tracing = { version = "0.1.25", optional = true }
[dev-dependencies] [dev-dependencies]
tokio = { version = "1.0.0", path = "../tokio", features = ["full"] } tokio = { version = "1.0.0", path = "../tokio", features = ["full"] }
+2 -2
View File
@@ -7,12 +7,12 @@ use tokio::io::{AsyncRead, AsyncWrite};
use bytes::BytesMut; use bytes::BytesMut;
use futures_core::ready; use futures_core::ready;
use futures_sink::Sink; use futures_sink::Sink;
use log::trace;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;
use std::borrow::{Borrow, BorrowMut}; use std::borrow::{Borrow, BorrowMut};
use std::io; use std::io;
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use tracing::trace;
pin_project! { pin_project! {
#[derive(Debug)] #[derive(Debug)]
@@ -278,7 +278,7 @@ where
while !pinned.state.borrow_mut().buffer.is_empty() { while !pinned.state.borrow_mut().buffer.is_empty() {
let WriteFrame { buffer } = pinned.state.borrow_mut(); let WriteFrame { buffer } = pinned.state.borrow_mut();
trace!("writing; remaining={}", buffer.len()); trace!(remaining = buffer.len(), "writing;");
let n = ready!(poll_write_buf(pinned.inner.as_mut(), cx, buffer))?; let n = ready!(poll_write_buf(pinned.inner.as_mut(), cx, buffer))?;