codec: make tracing feature optional for codecs (#6434)

Signed-off-by: Jens Reidel <[email protected]>
This commit is contained in:
Jens Reidel
2024-03-30 18:20:05 +01:00
committed by GitHub
parent 1fcb77db34
commit d298049299
4 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ full = ["codec", "compat", "io-util", "time", "net", "rt"]
net = ["tokio/net"]
compat = ["futures-io",]
codec = ["tracing"]
codec = []
time = ["tokio/time","slab"]
io = []
io-util = ["io", "tokio/rt", "tokio/io-util"]
-1
View File
@@ -12,7 +12,6 @@ use std::borrow::{Borrow, BorrowMut};
use std::io;
use std::pin::Pin;
use std::task::{Context, Poll};
use tracing::trace;
pin_project! {
#[derive(Debug)]
+3
View File
@@ -25,6 +25,9 @@ mod cfg;
mod loom;
cfg_codec! {
#[macro_use]
mod tracing;
pub mod codec;
}
+6
View File
@@ -0,0 +1,6 @@
macro_rules! trace {
($($arg:tt)*) => {
#[cfg(feature = "tracing")]
tracing::trace!($($arg)*);
};
}