Skip to content

Commit

Permalink
refactor(iroh-net): Debug logging should not be per packet set (#2818)
Browse files Browse the repository at this point in the history
## Description

These are logged for each packet on the relay path.  That's not what
we do on debug logging.  One case is already covered by other trace
logging, so just move the "why", the other case can be a trace log.

## Breaking Changes

None

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
  • Loading branch information
flub authored Oct 18, 2024
1 parent f32f3f9 commit c82ada5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion iroh-net/src/magicsock/relay_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ impl RelayActor {
url: &RelayUrl,
remote_node: Option<&NodeId>,
) -> relay::client::Client {
debug!(%url, ?remote_node, "connect relay");
trace!(%url, ?remote_node, "connect relay");
// See if we have a connection open to that relay node ID first. If so, might as
// well use it. (It's a little arbitrary whether we use this one vs. the reverse route
// below when we have both.)
Expand Down
8 changes: 1 addition & 7 deletions iroh-net/src/relay/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,6 @@ impl Actor {
&mut self,
why: &'static str,
) -> Result<(Conn, &'_ mut ConnReceiver), ClientError> {
debug!(
"connect: {}, current client {}",
why,
self.relay_conn.is_some()
);

if self.is_closed {
return Err(ClientError::Closed);
}
Expand All @@ -590,7 +584,7 @@ impl Actor {

Ok((conn, receiver))
}
.instrument(info_span!("connect", %url))
.instrument(info_span!("connect", %url, %why))
.await
}

Expand Down

0 comments on commit c82ada5

Please sign in to comment.