Skip to content

Commit

Permalink
fix: add example metrics's tracing::info
Browse files Browse the repository at this point in the history
Adding a Minimal `println!()` Syntax for Metrics Example

Pull-Request: #5440.
  • Loading branch information
elecbug authored Jun 5, 2024
1 parent 3da7d91 commit 01f7b40
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/metrics/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ async fn main() -> Result<(), Box<dyn Error>> {

loop {
match swarm.select_next_some().await {
SwarmEvent::NewListenAddr { address, .. } => {
tracing::info!(
"Local node is listening on\n {}/p2p/{}",
address,
swarm.local_peer_id()
);
}
SwarmEvent::Behaviour(BehaviourEvent::Ping(ping_event)) => {
tracing::info!(?ping_event);
metrics.record(&ping_event);
Expand Down

0 comments on commit 01f7b40

Please sign in to comment.