diff options
| author | mat <git@matdoes.dev> | 2023-12-16 13:28:22 -0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-12-16 13:28:22 -0600 |
| commit | 9260892d44f2072be5c5be0c28ff37a6476ae25b (patch) | |
| tree | 0b47e835d4d1192bb21cf484c4c5deda125e6f59 | |
| parent | dc26558415f697433d2ada8e32c11dfa28ed5827 (diff) | |
| download | azalea-drasl-9260892d44f2072be5c5be0c28ff37a6476ae25b.tar.xz | |
fix bytes of packets not being logged in tracing
| -rw-r--r-- | Cargo.lock | 1 | ||||
| -rw-r--r-- | azalea-protocol/Cargo.toml | 1 | ||||
| -rwxr-xr-x | azalea-protocol/src/read.rs | 5 |
3 files changed, 4 insertions, 3 deletions
@@ -444,6 +444,7 @@ dependencies = [ "futures", "futures-lite 2.1.0", "futures-util", + "log", "once_cell", "serde", "serde_json", diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index 9cbc4859..e5ff3824 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -46,6 +46,7 @@ trust-dns-resolver = { version = "^0.23.2", default-features = false, features = "tokio-runtime", ] } uuid = "1.6.1" +log = "0.4.20" [features] connecting = [] diff --git a/azalea-protocol/src/read.rs b/azalea-protocol/src/read.rs index 6b730d3f..7c641c76 100755 --- a/azalea-protocol/src/read.rs +++ b/azalea-protocol/src/read.rs @@ -17,7 +17,6 @@ use std::{ use thiserror::Error; use tokio::io::AsyncRead; use tokio_util::codec::{BytesCodec, FramedRead}; -use tracing::if_log_enabled; #[derive(Error, Debug)] pub enum ReadPacketError { @@ -348,7 +347,7 @@ where .map_err(ReadPacketError::from)?; } - if_log_enabled!(tracing::Level::TRACE, { + if log::log_enabled!(log::Level::Trace) { let buf_string: String = { if buf.len() > 500 { let cut_off_buf = &buf[..500]; @@ -358,7 +357,7 @@ where } }; tracing::trace!("Reading packet with bytes: {buf_string}"); - }); + }; Ok(Some(buf)) } |
