aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-11-18 00:58:47 -0600
committermat <git@matdoes.dev>2023-11-18 00:58:47 -0600
commit9633508a3a31a70c657329fdeca0050b7082959e (patch)
tree9973ed4e60a0bd2b77413a195b2a166854f04d43 /azalea-protocol
parentb79ae025f08935044c621259d4e0c4bb72bbcd7f (diff)
downloadazalea-drasl-9633508a3a31a70c657329fdeca0050b7082959e.tar.xz
replace log with tracing
Diffstat (limited to 'azalea-protocol')
-rw-r--r--azalea-protocol/Cargo.toml2
-rw-r--r--azalea-protocol/examples/handshake_proxy.rs2
-rwxr-xr-xazalea-protocol/src/connect.rs2
-rwxr-xr-xazalea-protocol/src/packets/game/clientbound_commands_packet.rs2
-rwxr-xr-xazalea-protocol/src/read.rs6
-rwxr-xr-xazalea-protocol/src/write.rs2
6 files changed, 8 insertions, 8 deletions
diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml
index 4c849573..934152e5 100644
--- a/azalea-protocol/Cargo.toml
+++ b/azalea-protocol/Cargo.toml
@@ -40,7 +40,7 @@ flate2 = "1.0.28"
futures = "0.3.29"
futures-lite = "2.0.1"
futures-util = "0.3.29"
-log = "0.4.20"
+tracing = "0.1.40"
serde = { version = "^1.0", features = ["serde_derive"] }
serde_json = "^1.0.108"
thiserror = "1.0.50"
diff --git a/azalea-protocol/examples/handshake_proxy.rs b/azalea-protocol/examples/handshake_proxy.rs
index f7fb0f5c..4e9719b0 100644
--- a/azalea-protocol/examples/handshake_proxy.rs
+++ b/azalea-protocol/examples/handshake_proxy.rs
@@ -21,7 +21,6 @@ use azalea_protocol::{
read::ReadPacketError,
};
use futures::FutureExt;
-use log::{error, info, warn};
use once_cell::sync::Lazy;
use std::error::Error;
use tokio::{
@@ -29,6 +28,7 @@ use tokio::{
net::{TcpListener, TcpStream},
};
use tracing::Level;
+use tracing::{error, info, warn};
const LISTEN_ADDR: &str = "127.0.0.1:25566";
const PROXY_ADDR: &str = "127.0.0.1:25565";
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs
index 9c573506..86b92693 100755
--- a/azalea-protocol/src/connect.rs
+++ b/azalea-protocol/src/connect.rs
@@ -15,7 +15,6 @@ use azalea_auth::game_profile::GameProfile;
use azalea_auth::sessionserver::{ClientSessionServerError, ServerSessionServerError};
use azalea_crypto::{Aes128CfbDec, Aes128CfbEnc};
use bytes::BytesMut;
-use log::{error, info};
use std::fmt::Debug;
use std::io::Cursor;
use std::marker::PhantomData;
@@ -24,6 +23,7 @@ use thiserror::Error;
use tokio::io::AsyncWriteExt;
use tokio::net::tcp::{OwnedReadHalf, OwnedWriteHalf, ReuniteError};
use tokio::net::TcpStream;
+use tracing::{error, info};
use uuid::Uuid;
pub struct RawReadConnection {
diff --git a/azalea-protocol/src/packets/game/clientbound_commands_packet.rs b/azalea-protocol/src/packets/game/clientbound_commands_packet.rs
index 0b14fbd1..0bc436be 100755
--- a/azalea-protocol/src/packets/game/clientbound_commands_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_commands_packet.rs
@@ -3,8 +3,8 @@ use azalea_buf::{
};
use azalea_core::{bitset::FixedBitSet, resource_location::ResourceLocation};
use azalea_protocol_macros::ClientboundGamePacket;
-use log::warn;
use std::io::{Cursor, Write};
+use tracing::warn;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
pub struct ClientboundCommandsPacket {
diff --git a/azalea-protocol/src/read.rs b/azalea-protocol/src/read.rs
index 4002f4cb..d1985b31 100755
--- a/azalea-protocol/src/read.rs
+++ b/azalea-protocol/src/read.rs
@@ -9,7 +9,6 @@ use bytes::BytesMut;
use flate2::read::ZlibDecoder;
use futures::StreamExt;
use futures_lite::future;
-use log::{log_enabled, trace};
use std::backtrace::Backtrace;
use std::{
fmt::Debug,
@@ -18,6 +17,7 @@ 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 {
@@ -346,7 +346,7 @@ where
.map_err(ReadPacketError::from)?;
}
- if log_enabled!(log::Level::Trace) {
+ if_log_enabled!(tracing::Level::TRACE, {
let buf_string: String = {
if buf.len() > 500 {
let cut_off_buf = &buf[..500];
@@ -356,7 +356,7 @@ where
}
};
trace!("Reading packet with bytes: {buf_string}");
- }
+ });
Ok(Some(buf))
}
diff --git a/azalea-protocol/src/write.rs b/azalea-protocol/src/write.rs
index 0c3131a0..6ce01bf7 100755
--- a/azalea-protocol/src/write.rs
+++ b/azalea-protocol/src/write.rs
@@ -4,10 +4,10 @@ use crate::{packets::ProtocolPacket, read::MAXIMUM_UNCOMPRESSED_LENGTH};
use async_compression::tokio::bufread::ZlibEncoder;
use azalea_buf::McBufVarWritable;
use azalea_crypto::Aes128CfbEnc;
-use log::trace;
use std::fmt::Debug;
use thiserror::Error;
use tokio::io::{AsyncReadExt, AsyncWrite, AsyncWriteExt};
+use tracing::trace;
/// Prepend the length of the packet to it.
fn frame_prepender(mut data: Vec<u8>) -> Result<Vec<u8>, std::io::Error> {