diff options
author | Carl Lerche <me@carllerche.com> | 2019-10-23 11:04:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-23 11:04:14 -0700 |
commit | 99940aeeb478e1c96959aed69561336ab067d0d3 (patch) | |
tree | 69f15d1931e8e52708827caa80628711e35ef487 /tokio/src | |
parent | cfc15617a5247ea780c32c85b7134b88b6de5845 (diff) |
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.
Diffstat (limited to 'tokio/src')
-rw-r--r-- | tokio/src/runtime/threadpool/builder.rs | 25 | ||||
-rw-r--r-- | tokio/src/runtime/threadpool/mod.rs | 10 |
2 files changed, 8 insertions, 27 deletions
diff --git a/tokio/src/runtime/threadpool/builder.rs b/tokio/src/runtime/threadpool/builder.rs index 7f6f27f4..df0ff337 100644 --- a/tokio/src/runtime/threadpool/builder.rs +++ b/tokio/src/runtime/threadpool/builder.rs @@ -5,7 +5,6 @@ use crate::timer::timer::{self, Timer}; use tokio_executor::thread_pool; use tokio_net::driver::{self, Reactor}; -use tracing_core as trace; use std::{fmt, io}; use std::sync::{Arc, Mutex}; @@ -241,13 +240,6 @@ impl Builder { // Get a handle to the clock for the runtime. let clock = self.clock.clone(); - // Get the current trace dispatcher. - // TODO(eliza): when `tokio-trace-core` is stable enough to take a - // public API dependency, we should allow users to set a custom - // subscriber for the runtime. - let dispatch = trace::dispatcher::get_default(trace::Dispatch::clone); - let trace = dispatch.clone(); - let around_reactor_handles = reactor_handles.clone(); let around_timer_handles = timer_handles.clone(); @@ -260,17 +252,15 @@ impl Builder { let _reactor = driver::set_default(&around_reactor_handles[index]); clock::with_default(&clock, || { let _timer = timer::set_default(&around_timer_handles[index]); - trace::dispatcher::with_default(&dispatch, || { - if let Some(after_start) = after_start.as_ref() { - after_start(); - } + if let Some(after_start) = after_start.as_ref() { + after_start(); + } - next(); + next(); - if let Some(before_stop) = before_stop.as_ref() { - before_stop(); - } - }) + if let Some(before_stop) = before_stop.as_ref() { + before_stop(); + } }) }) .build_with_park(move |index| { @@ -286,7 +276,6 @@ impl Builder { pool, reactor_handles, timer_handles, - trace, }), }) } diff --git a/tokio/src/runtime/threadpool/mod.rs b/tokio/src/runtime/threadpool/mod.rs index e23cda4d..441b2059 100644 --- a/tokio/src/runtime/threadpool/mod.rs +++ b/tokio/src/runtime/threadpool/mod.rs @@ -14,7 +14,6 @@ use crate::timer::timer; use tokio_executor::thread_pool::ThreadPool; use tokio_net::driver; -use tracing_core as trace; use std::future::Future; use std::io; @@ -47,9 +46,6 @@ struct Inner { /// Timer handles timer_handles: Vec<timer::Handle>, - - /// Tracing dispatcher - trace: trace::Dispatch, } // ===== impl Runtime ===== @@ -137,14 +133,10 @@ impl Runtime { where F: Future, { - let trace = &self.inner().trace; - let _reactor = driver::set_default(&self.inner().reactor_handles[0]); let _timer = timer::set_default(&self.inner().timer_handles[0]); - trace::dispatcher::with_default(trace, || { - self.inner().pool.block_on(future) - }) + self.inner().pool.block_on(future) } /// Return a handle to the runtime's spawner. |