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:
Carl Lerche
2019-10-23 11:04:14 -07:00
committed by GitHub
parent cfc15617a5
commit 99940aeeb4
14 changed files with 13 additions and 246 deletions
-13
View File
@@ -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"),