From 14a6f9d9f89452b56102ffc5dc61125cc2b63aff Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 19 Sep 2022 19:53:16 +0000 Subject: replace printlns with log --- azalea-protocol/src/lib.rs | 4 +++- azalea-protocol/src/packets/game/clientbound_commands_packet.rs | 3 ++- azalea-protocol/src/resolver.rs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'azalea-protocol/src') diff --git a/azalea-protocol/src/lib.rs b/azalea-protocol/src/lib.rs index 1f864d45..9fff59f8 100755 --- a/azalea-protocol/src/lib.rs +++ b/azalea-protocol/src/lib.rs @@ -43,8 +43,10 @@ impl<'a> TryFrom<&'a str> for ServerAddress { #[cfg(feature = "connecting")] pub async fn connect(address: ServerAddress) -> Result<(), Box> { + use log::debug; + let resolved_address = resolver::resolve_address(&address).await; - println!("Resolved address: {:?}", resolved_address); + debug!("Resolved address: {:?}", resolved_address); Ok(()) } diff --git a/azalea-protocol/src/packets/game/clientbound_commands_packet.rs b/azalea-protocol/src/packets/game/clientbound_commands_packet.rs index c05f710a..e18cf52b 100644 --- a/azalea-protocol/src/packets/game/clientbound_commands_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_commands_packet.rs @@ -4,6 +4,7 @@ use azalea_buf::McBufVarReadable; use azalea_buf::{McBufReadable, McBufWritable}; use azalea_core::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; +use log::warn; use std::io::{Read, Write}; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] @@ -205,7 +206,7 @@ impl McBufReadable for BrigadierNodeStub { fn read_from(buf: &mut impl Read) -> Result { let flags = u8::read_from(buf)?; if flags > 31 { - eprintln!( + warn!( "Warning: The flags from a Brigadier node are over 31 ({flags}; {flags:#b}). This is probably a bug.", ); } diff --git a/azalea-protocol/src/resolver.rs b/azalea-protocol/src/resolver.rs index e21362a5..eb081c3f 100755 --- a/azalea-protocol/src/resolver.rs +++ b/azalea-protocol/src/resolver.rs @@ -47,7 +47,7 @@ pub async fn resolve_address(address: &ServerAddress) -> Result