Skip to content

Commit 7a62f5c

Browse files
committed
update
1 parent 1b60127 commit 7a62f5c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

connecting/endpoint-hooks.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use iroh::{
2525
Endpoint, EndpointAddr, Watcher,
2626
endpoint::{AfterHandshakeOutcome, BeforeConnectOutcome, ConnectionInfo, EndpointHooks},
2727
};
28+
use tracing::info;
2829

2930
/// Our hooks instance.
3031
///
@@ -40,7 +41,7 @@ impl EndpointHooks for LogHooks {
4041
remote_addr: &EndpointAddr,
4142
alpn: &[u8],
4243
) -> BeforeConnectOutcome {
43-
tracing::info!(?remote_addr, ?alpn, "attempting to connect");
44+
info!(?remote_addr, ?alpn, "attempting to connect");
4445
BeforeConnectOutcome::Accept
4546
}
4647

@@ -52,13 +53,13 @@ impl EndpointHooks for LogHooks {
5253
let side = conn.side();
5354
let remote = conn.remote_id().fmt_short();
5455

55-
tracing::info!(%remote, alpn=?conn.alpn(), ?side, "connection established");
56+
info!(%remote, alpn=?conn.alpn(), ?side, "connection established");
5657

5758
// We can spawn a task to observe network path changes for this connection.
5859
let mut path_updates = conn.paths();
5960
tokio::spawn(async move {
6061
while let Ok(paths) = path_updates.updated().await {
61-
tracing::info!(%remote, ?paths, "paths updated");
62+
info!(%remote, ?paths, "paths updated");
6263
}
6364
});
6465

0 commit comments

Comments
 (0)