aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-05-07 06:48:59 -1100
committermat <git@matdoes.dev>2025-05-07 06:48:59 -1100
commita8e76a0bff182bbcb7b40e9283f78efbac7e630c (patch)
tree64a8296bb0400e2aaf92d1ebfec2158115341236
parent2b7be768f29bd77661be31fe6e107c1be84853e7 (diff)
downloadazalea-drasl-a8e76a0bff182bbcb7b40e9283f78efbac7e630c.tar.xz
impl Display for proxy and trace log JoinOpts
-rw-r--r--azalea-protocol/src/connect.rs11
-rw-r--r--azalea/src/swarm/mod.rs5
2 files changed, 14 insertions, 2 deletions
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs
index 3d375dfc..8d2711a7 100644
--- a/azalea-protocol/src/connect.rs
+++ b/azalea-protocol/src/connect.rs
@@ -1,6 +1,6 @@
//! Connect to remote servers/clients.
-use std::fmt::Debug;
+use std::fmt::{self, Debug, Display};
use std::io::{self, Cursor};
use std::marker::PhantomData;
use std::net::SocketAddr;
@@ -274,6 +274,15 @@ impl Proxy {
Self { addr, auth }
}
}
+impl Display for Proxy {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "socks5://")?;
+ if let Some(auth) = &self.auth {
+ write!(f, "{}@", auth)?;
+ }
+ write!(f, "{}", self.addr)
+ }
+}
impl Connection<ClientboundHandshakePacket, ServerboundHandshakePacket> {
/// Create a new connection to the given address.
diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs
index 57a12608..e78091df 100644
--- a/azalea/src/swarm/mod.rs
+++ b/azalea/src/swarm/mod.rs
@@ -705,7 +705,10 @@ impl Swarm {
state: S,
join_opts: &JoinOpts,
) -> Result<Client, JoinError> {
- debug!("add_with_opts called for account {}", account.username);
+ debug!(
+ "add_with_opts called for account {} with opts {join_opts:?}",
+ account.username
+ );
let address = join_opts
.custom_address