mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
chore: remove tracing. (#1680)
Historically, logging has been added haphazardly. Here, we entirely remove logging as none of it is particularly useful. In the future, we will add tracing back in order to expose useful data to the user of Tokio.
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
#![cfg(feature = "process")]
|
||||
#![warn(rust_2018_idioms)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
||||
use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};
|
||||
use tokio_net::process::{Child, Command};
|
||||
|
||||
@@ -38,10 +35,7 @@ async fn feed_cat(mut cat: Child, n: usize) -> io::Result<ExitStatus> {
|
||||
|
||||
// Produce n lines on the child's stdout.
|
||||
let write = async {
|
||||
debug!("starting to feed");
|
||||
|
||||
for i in 0..n {
|
||||
debug!("sending line {} to child", i);
|
||||
let bytes = format!("line {}\n", i).into_bytes();
|
||||
stdin.write_all(&bytes).await.unwrap();
|
||||
}
|
||||
@@ -56,8 +50,6 @@ async fn feed_cat(mut cat: Child, n: usize) -> io::Result<ExitStatus> {
|
||||
// Try to read `n + 1` lines, ensuring the last one is empty
|
||||
// (i.e. EOF is reached after `n` lines.
|
||||
loop {
|
||||
debug!("starting read from child");
|
||||
|
||||
let data = reader
|
||||
.next()
|
||||
.await
|
||||
@@ -67,11 +59,6 @@ async fn feed_cat(mut cat: Child, n: usize) -> io::Result<ExitStatus> {
|
||||
let num_read = data.len();
|
||||
let done = num_lines >= n;
|
||||
|
||||
debug!(
|
||||
"read line {} from child ({} bytes, done: {})",
|
||||
num_lines, num_read, done
|
||||
);
|
||||
|
||||
match (done, num_read) {
|
||||
(false, 0) => panic!("broken pipe"),
|
||||
(true, n) if n != 0 => panic!("extraneous data"),
|
||||
|
||||
Reference in New Issue
Block a user