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
-4
View File
@@ -71,10 +71,6 @@ macro_rules! thread_local {
#[macro_use]
mod tests;
#[cfg(any(feature = "current-thread", feature = "threadpool"))]
#[macro_use]
mod tracing;
mod enter;
mod error;
mod executor;
-84
View File
@@ -1,84 +0,0 @@
#![allow(unused_macros)]
//! This module provides a small facade that wraps the `tracing` APIs we use, so
//! that when the `tracing` dependency is disabled, `tracing`'s macros expand to
//! no-ops.
//!
//! This means we don't have to put a `#[cfg(feature = "tracing")]` on every
//! individual use of a `tracing` macro.
#[cfg(not(feature = "tracing"))]
#[derive(Clone, Debug)]
pub(crate) struct Span {}
#[cfg(feature = "tracing")]
macro_rules! trace {
($($arg:tt)+) => {
tracing::trace!($($arg)+)
};
}
#[cfg(not(feature = "tracing"))]
macro_rules! trace {
($($arg:tt)+) => {};
}
#[cfg(feature = "tracing")]
macro_rules! debug {
($($arg:tt)+) => {
tracing::debug!($($arg)+)
};
}
#[cfg(not(feature = "tracing"))]
macro_rules! debug {
($($arg:tt)+) => {};
}
#[cfg(feature = "tracing")]
macro_rules! warn {
($($arg:tt)+) => {
tracing::warn!($($arg)+)
};
}
#[cfg(not(feature = "tracing"))]
macro_rules! warn {
($($arg:tt)+) => {};
}
#[cfg(feature = "tracing")]
macro_rules! error {
($($arg:tt)+) => {
tracing::error!($($arg)+)
};
}
#[cfg(not(feature = "tracing"))]
macro_rules! error {
($($arg:tt)+) => {};
}
#[cfg(feature = "tracing")]
macro_rules! trace_span {
($($arg:tt)+) => {
tracing::trace_span!($($arg)+)
};
}
#[cfg(not(feature = "tracing"))]
macro_rules! trace_span {
($($arg:tt)+) => {
crate::tracing::Span::new()
};
}
#[cfg(not(feature = "tracing"))]
impl Span {
pub(crate) fn new() -> Self {
Span {}
}
pub(crate) fn enter(&self) -> Span {
Span {}
}
}