aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUbuntu <github@matdoes.dev>2022-09-09 19:27:59 +0000
committerUbuntu <github@matdoes.dev>2022-09-09 19:27:59 +0000
commitc033587503eedc822cd3c9d44bf60a6dc51f8263 (patch)
tree2c775d195a2198db52a244e95d70dd457d548915
parent98000f800f31c85c7bbf121b116047137b503c49 (diff)
downloadazalea-drasl-c033587503eedc822cd3c9d44bf60a6dc51f8263.tar.xz
add logger
-rwxr-xr-xCargo.lock1
-rwxr-xr-xazalea-protocol/Cargo.toml1
-rwxr-xr-xazalea-protocol/src/read.rs3
3 files changed, 5 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 19d15e25..9999ae32 100755
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -249,6 +249,7 @@ dependencies = [
"byteorder",
"bytes",
"flate2",
+ "log",
"serde",
"serde_json",
"thiserror",
diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml
index 513e324c..62de47d9 100755
--- a/azalea-protocol/Cargo.toml
+++ b/azalea-protocol/Cargo.toml
@@ -24,6 +24,7 @@ azalea-world = {path = "../azalea-world", version = "^0.1.0"}
byteorder = "^1.4.3"
bytes = "^1.1.0"
flate2 = "1.0.23"
+log = "0.4.17"
serde = {version = "1.0.130", features = ["serde_derive"]}
serde_json = "^1.0.72"
thiserror = "^1.0.34"
diff --git a/azalea-protocol/src/read.rs b/azalea-protocol/src/read.rs
index aa99c4a7..f7c783de 100755
--- a/azalea-protocol/src/read.rs
+++ b/azalea-protocol/src/read.rs
@@ -3,6 +3,7 @@ use azalea_buf::McBufVarReadable;
use azalea_buf::{read_varint_async, BufReadError};
use azalea_crypto::Aes128CfbDec;
use flate2::read::ZlibDecoder;
+use log::trace;
use std::{
cell::Cell,
io::Read,
@@ -200,6 +201,8 @@ where
buf = compression_decoder(&mut buf.as_slice(), compression_threshold)?;
}
+ trace!("Reading packet with bytes: {buf:?}");
+
let packet = packet_decoder(&mut buf.as_slice())?;
Ok(packet)