diff options
| author | mat <git@matdoes.dev> | 2023-11-18 00:58:47 -0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-11-18 00:58:47 -0600 |
| commit | 9633508a3a31a70c657329fdeca0050b7082959e (patch) | |
| tree | 9973ed4e60a0bd2b77413a195b2a166854f04d43 /azalea-protocol/src | |
| parent | b79ae025f08935044c621259d4e0c4bb72bbcd7f (diff) | |
| download | azalea-drasl-9633508a3a31a70c657329fdeca0050b7082959e.tar.xz | |
replace log with tracing
Diffstat (limited to 'azalea-protocol/src')
| -rwxr-xr-x | azalea-protocol/src/connect.rs | 2 | ||||
| -rwxr-xr-x | azalea-protocol/src/packets/game/clientbound_commands_packet.rs | 2 | ||||
| -rwxr-xr-x | azalea-protocol/src/read.rs | 6 | ||||
| -rwxr-xr-x | azalea-protocol/src/write.rs | 2 |
4 files changed, 6 insertions, 6 deletions
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> { |
