Skip to content

Commit

Permalink
remove crit! logging from ListenerClosed event on Ok() (#4821)
Browse files Browse the repository at this point in the history
## Issue Addressed

Since adding Quic support on #4577, and due to `quinn`s api nature LH now triggers the [`ListenerClosed`](https://docs.rs/libp2p/0.52.3/libp2p/swarm/struct.ListenerClosed.html) event.. @michaelsproul noticed we are logging this event as `crit!` independently of the reason. This PR matches the reason, logging with `debug!` and `error!` (instead of `crit!`) according to its `Result`  
## Additional Info
LH will still log `crit!` until libp2p/rust-libp2p#4621 has been merged
  • Loading branch information
jxs committed Oct 18, 2023
1 parent 18f3edf commit f10d3d0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion beacon_node/lighthouse_network/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,14 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
SwarmEvent::ListenerClosed {
addresses, reason, ..
} => {
crit!(self.log, "Listener closed"; "addresses" => ?addresses, "reason" => ?reason);
match reason {
Ok(_) => {
debug!(self.log, "Listener gracefuly closed"; "addresses" => ?addresses)
}
Err(reason) => {
crit!(self.log, "Listener abruptly closed"; "addresses" => ?addresses, "reason" => ?reason)
}
};
if Swarm::listeners(&self.swarm).count() == 0 {
Some(NetworkEvent::ZeroListeners)
} else {
Expand Down

0 comments on commit f10d3d0

Please sign in to comment.