mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 23:44:38 +00:00
fix bytes of packets not being logged in tracing
This commit is contained in:
parent
ea3e860012
commit
f16206d2fd
4 changed files with 274260 additions and 6 deletions
5
Cargo.lock
generated
5
Cargo.lock
generated
|
@ -439,6 +439,7 @@ dependencies = [
|
|||
"futures",
|
||||
"futures-lite 2.0.1",
|
||||
"futures-util",
|
||||
"log",
|
||||
"once_cell",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
@ -2885,9 +2886,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.5.0"
|
||||
version = "1.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc"
|
||||
checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"md-5",
|
||||
|
|
274253
azalea-block/out.rs
Normal file
274253
azalea-block/out.rs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -43,7 +43,8 @@ tokio-util = { version = "0.7.10", features = ["codec"] }
|
|||
trust-dns-resolver = { version = "^0.23.2", default-features = false, features = [
|
||||
"tokio-runtime",
|
||||
] }
|
||||
uuid = "1.5.0"
|
||||
uuid = "1.6.1"
|
||||
log = "0.4.20"
|
||||
|
||||
[features]
|
||||
connecting = []
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue