pub struct NatTraversalLogger { /* private fields */ }Expand description
Structured logger for NAT traversal operations
Implementations§
Source§impl NatTraversalLogger
impl NatTraversalLogger
Sourcepub fn new(config: LoggingConfig) -> Self
pub fn new(config: LoggingConfig) -> Self
Create new NAT traversal logger
Sourcepub fn set_context(&mut self, context: LoggingContext)
pub fn set_context(&mut self, context: LoggingContext)
Set logging context
Sourcepub fn set_phase(&mut self, phase: NatTraversalPhase)
pub fn set_phase(&mut self, phase: NatTraversalPhase)
Update current phase
Sourcepub fn add_context(&mut self, key: String, value: String)
pub fn add_context(&mut self, key: String, value: String)
Add context field
Sourcepub fn log_phase_transition(
&self,
from_phase: NatTraversalPhase,
to_phase: NatTraversalPhase,
duration: Option<Duration>,
)
pub fn log_phase_transition( &self, from_phase: NatTraversalPhase, to_phase: NatTraversalPhase, duration: Option<Duration>, )
Log phase transition
Sourcepub fn log_candidate_discovery_start(
&self,
bootstrap_nodes: &[SocketAddr],
nat_type: Option<NatType>,
)
pub fn log_candidate_discovery_start( &self, bootstrap_nodes: &[SocketAddr], nat_type: Option<NatType>, )
Log candidate discovery start
Sourcepub fn log_candidate_discovered(&self, candidate: &CandidateInfo)
pub fn log_candidate_discovered(&self, candidate: &CandidateInfo)
Log candidate discovered
Sourcepub fn log_coordination_request(
&self,
coordinator: SocketAddr,
round_id: VarInt,
candidates: &[CandidateInfo],
)
pub fn log_coordination_request( &self, coordinator: SocketAddr, round_id: VarInt, candidates: &[CandidateInfo], )
Log bootstrap coordination request
Sourcepub fn log_coordination_response(
&self,
coordinator: SocketAddr,
success: bool,
peer_candidates: Option<&[CandidateInfo]>,
)
pub fn log_coordination_response( &self, coordinator: SocketAddr, success: bool, peer_candidates: Option<&[CandidateInfo]>, )
Log coordination response
Sourcepub fn log_hole_punching_start(
&self,
target_addresses: &[SocketAddr],
strategy: &str,
)
pub fn log_hole_punching_start( &self, target_addresses: &[SocketAddr], strategy: &str, )
Log hole punching start
Sourcepub fn log_hole_punch_attempt(
&self,
target: SocketAddr,
attempt_number: u32,
packet_size: usize,
)
pub fn log_hole_punch_attempt( &self, target: SocketAddr, attempt_number: u32, packet_size: usize, )
Log hole punching attempt
Sourcepub fn log_hole_punch_result(
&self,
target: SocketAddr,
success: bool,
response_time: Option<Duration>,
)
pub fn log_hole_punch_result( &self, target: SocketAddr, success: bool, response_time: Option<Duration>, )
Log hole punching result
Sourcepub fn log_path_validation_start(&self, paths: &[SocketAddr])
pub fn log_path_validation_start(&self, paths: &[SocketAddr])
Log path validation start
Sourcepub fn log_path_validation_result(
&self,
path: SocketAddr,
success: bool,
rtt: Option<Duration>,
error: Option<&str>,
)
pub fn log_path_validation_result( &self, path: SocketAddr, success: bool, rtt: Option<Duration>, error: Option<&str>, )
Log path validation result
Sourcepub fn log_connection_established(
&self,
remote_address: SocketAddr,
total_time: Duration,
method: &str,
)
pub fn log_connection_established( &self, remote_address: SocketAddr, total_time: Duration, method: &str, )
Log connection establishment
Sourcepub fn log_traversal_failure(
&self,
error_category: ErrorCategory,
error_message: &str,
total_time: Duration,
attempts: u32,
)
pub fn log_traversal_failure( &self, error_category: ErrorCategory, error_message: &str, total_time: Duration, attempts: u32, )
Log NAT traversal failure
Sourcepub fn log_frame_transmission(
&self,
frame_type: &str,
destination: SocketAddr,
frame_size: usize,
sequence: Option<u64>,
)
pub fn log_frame_transmission( &self, frame_type: &str, destination: SocketAddr, frame_size: usize, sequence: Option<u64>, )
Log frame transmission
Sourcepub fn log_frame_reception(
&self,
frame_type: &str,
source: SocketAddr,
frame_size: usize,
sequence: Option<u64>,
)
pub fn log_frame_reception( &self, frame_type: &str, source: SocketAddr, frame_size: usize, sequence: Option<u64>, )
Log frame reception
Sourcepub fn log_performance_metrics(&self, metrics: &PerformanceMetrics)
pub fn log_performance_metrics(&self, metrics: &PerformanceMetrics)
Log performance metrics
Sourcepub fn log_failure_diagnostics(&self, diagnostics: &FailureDiagnostics)
pub fn log_failure_diagnostics(&self, diagnostics: &FailureDiagnostics)
Log diagnostic information for failures
Sourcepub fn create_traversal_span(&self, operation: &str) -> Span
pub fn create_traversal_span(&self, operation: &str) -> Span
Create a tracing span for NAT traversal operation
Auto Trait Implementations§
impl Freeze for NatTraversalLogger
impl RefUnwindSafe for NatTraversalLogger
impl Send for NatTraversalLogger
impl Sync for NatTraversalLogger
impl Unpin for NatTraversalLogger
impl UnwindSafe for NatTraversalLogger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more