mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +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:
@@ -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;
|
||||
|
||||
@@ -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 {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user