Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: minimal fmt::Debug impl for STUN Attributes #452

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

thomaseizinger
Copy link
Collaborator

When the debug log level is activated, str0m logs each STUN request that it sends. This is useful but in its current configuration very noise, see:

| 2024-01-25T01:08:01.612757Z DEBUG str0m::ice_::agent: Send STUN request: 172.18.0.3:50261 -> 172.20.0.3:52550 StunMessage { method: Binding, class: Request, attrs: Attributes { username: Some("gpzm:qUls"), message_integrity: None, error_code: None, realm: None, nonce: None, xor_mapped_address: None, software: None, fingerprint: None, priority: Some(1862270719), use_candidate: false, ice_controlled: None, ice_controlling: Some(7816118197453770412), network_cost: None }, integrity_len: 0 }

This PR only logs the fields that are actually set which will transform the above into:

| 2024-01-25T01:08:01.612757Z DEBUG str0m::ice_::agent: Send STUN request: 172.18.0.3:50261 -> 172.20.0.3:52550 StunMessage { method: Binding, class: Request, attrs: Attributes { username: "gpzm:qUls", priority: 1862270719, ice_controlling: 7816118197453770412 }, integrity_len: 0 }

Copy link
Owner

@algesten algesten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@algesten algesten merged commit 30ba27e into algesten:main Jan 25, 2024
22 checks passed
@thomaseizinger thomaseizinger deleted the feat/friendlier-debug branch January 25, 2024 06:39
github-merge-queue bot pushed a commit to firezone/firezone that referenced this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants