Skip to content

Commit

Permalink
feat: add trace logging (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiapple852 committed May 12, 2023
1 parent 6c40b2c commit bc797d6
Show file tree
Hide file tree
Showing 12 changed files with 452 additions and 13 deletions.
137 changes: 137 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ thiserror = "1.0.40"
derive_more = "0.99.17"
arrayvec = "0.7.2"
socket2 = { version = "0.5.2", features = [ "all" ] }
tracing = "0.1.37"

# TUI dependencies
anyhow = "1.0.71"
Expand All @@ -46,6 +47,8 @@ etcetera = "0.8.0"
toml = "0.7.3"
indexmap = "1.9.3"
maxminddb = "0.23.0"
tracing-subscriber = { version = "0.3.17", features = ["env-filter", "json"] }
tracing-chrome = "0.7.1"

# Library dependencies (Linux)
[target.'cfg(target_os = "linux")'.dependencies]
Expand Down
2 changes: 2 additions & 0 deletions src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use parking_lot::RwLock;
use std::net::{IpAddr, Ipv4Addr};
use std::sync::Arc;
use std::time::Duration;
use tracing::instrument;
use trippy::tracing::{
Probe, ProbeStatus, Tracer, TracerChannel, TracerChannelConfig, TracerConfig, TracerRound,
};
Expand Down Expand Up @@ -266,6 +267,7 @@ impl Default for Hop {
///
/// Note that this implementation blocks the tracer on the `RwLock` and so any delays in the the TUI will delay the
/// next round of the started.
#[instrument(skip_all)]
pub fn run_backend(
tracer_config: &TracerConfig,
channel_config: &TracerChannelConfig,
Expand Down
Loading

0 comments on commit bc797d6

Please sign in to comment.