Skip to content

Conversation

@kixelated
Copy link
Collaborator

No description provided.

@kixelated kixelated enabled auto-merge (squash) January 7, 2026 04:34
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Walkthrough

This pull request migrates the logging infrastructure from the log crate to the tracing crate throughout the web-transport-quinn project. The log = "0.4" dependency is removed and replaced with tracing = "0.1", while tracing-subscriber is added as a dev-dependency. All logging calls across the codebase, including examples and source files, are updated from log::*! macros to tracing::*! macros. The logging initialization in examples is changed from env_logger to tracing_subscriber::fmt with environment-based filtering. Message formatting is updated to use structured logging with named fields where applicable.

Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No pull request description was provided by the author; the check cannot assess whether the description relates to the changeset. Add a description explaining the motivation and benefits of migrating to the tracing framework.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: migrating the logging framework from log/env_logger to tracing throughout the codebase.

✏️ Tip: You can configure your own custom Pre-merge Checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe44b6d and 4079a34.

📒 Files selected for processing (9)
  • web-transport-quinn/Cargo.toml
  • web-transport-quinn/examples/echo-client-advanced.rs
  • web-transport-quinn/examples/echo-client.rs
  • web-transport-quinn/examples/echo-server-advanced.rs
  • web-transport-quinn/examples/echo-server.rs
  • web-transport-quinn/src/client.rs
  • web-transport-quinn/src/connect.rs
  • web-transport-quinn/src/session.rs
  • web-transport-quinn/src/settings.rs
🧰 Additional context used
🧬 Code graph analysis (3)
web-transport-quinn/src/connect.rs (1)
web-transport-proto/src/connect.rs (2)
  • read (110-124)
  • read (184-198)
web-transport-quinn/examples/echo-server.rs (1)
web-transport-quinn/examples/echo-server-advanced.rs (2)
  • run_conn (97-118)
  • run_session (120-147)
web-transport-quinn/examples/echo-server-advanced.rs (1)
web-transport-quinn/examples/echo-server.rs (1)
  • run_session (91-118)
🔇 Additional comments (20)
web-transport-quinn/src/settings.rs (1)

50-50: LGTM! Clean migration to tracing with structured logging.

The migration correctly uses tracing::debug! with structured fields (?settings). The debug formatting will provide better observability compared to the previous logging approach.

Also applies to: 63-63

web-transport-quinn/src/client.rs (1)

71-71: LGTM! Structured error logging improves observability.

The migration to tracing::warn! with structured error fields (?err) will make it easier to filter and analyze certificate loading failures.

Also applies to: 77-77

web-transport-quinn/examples/echo-server-advanced.rs (3)

32-37: LGTM! Proper tracing subscriber initialization.

The initialization correctly uses tracing_subscriber::fmt() with environment-based filtering and a sensible fallback to "info" level.


78-78: LGTM! Effective structured logging throughout the connection lifecycle.

The logging statements correctly use structured fields where appropriate:

  • % for Display formatting (addr, url)
  • ? for Debug formatting (err)
  • Plain messages where structured fields aren't needed

This provides excellent observability for debugging connection issues.

Also applies to: 87-87, 98-98, 102-102, 106-106, 110-110, 114-114


126-126: LGTM! Structured message logging in the echo loop.

The migration correctly adds structured msg fields for received and sent data, which will make log analysis easier. Note that "echo successful!" was changed to "echo successful" (removed exclamation mark), which is a minor cosmetic change.

Also applies to: 130-130, 133-133, 137-138, 141-141, 145-145

web-transport-quinn/src/connect.rs (1)

45-45: LGTM! Consistent structured logging for CONNECT protocol.

The migration correctly uses tracing::debug! with structured fields for all CONNECT request/response logging. The ? formatting will automatically include all relevant Debug fields from the request/response types.

Also applies to: 59-59, 72-72, 76-76

web-transport-quinn/Cargo.toml (2)

54-54: Version constraint is appropriate and current.

The "0.3" constraint is suitable for a dev-dependency—it allows automatic access to the latest 0.3.x patches (currently 0.3.22 as of November 2025) while maintaining stability. The env-filter feature is available and compatible across all 0.3.x versions. No changes needed.


44-44: The tracing = "0.1" constraint is appropriate and follows Rust ecosystem best practices. The tracing crate is stable and maintains strong backward compatibility across all 0.1.x releases (currently at 0.1.44). The codebase uses only fundamental tracing functionality—basic logging macros (debug!, info!, warn!, error!, trace!) and simple field formatting—that are compatible with any version in the 0.1.x range. Broad version constraints on mature 0.x crates like tracing are standard practice and allow dependency consumers to benefit from bug fixes and non-breaking improvements.

Likely an incorrect or invalid review comment.

web-transport-quinn/examples/echo-client-advanced.rs (2)

22-27: LGTM! Clean tracing initialization.

The migration from env_logger to tracing_subscriber follows best practices, with proper environment-based filtering and a sensible fallback to the "info" level.


61-81: Excellent structured logging implementation.

The migration to tracing macros is complete and well-executed with proper use of structured fields. The % formatting prefix correctly applies Display formatting to the field values, and no log:: macro calls remain in the codebase.

web-transport-quinn/examples/echo-server.rs (3)

27-32: LGTM! Consistent initialization.

The tracing subscriber initialization matches the pattern used in other examples, ensuring consistent logging behavior across the codebase.


59-85: Proper use of structured logging with appropriate formatters.

The logging statements correctly use % for Display formatting (addresses, URLs) and ? for Debug formatting (errors), following tracing best practices.


97-116: Clean session logging implementation.

The structured logging in the session handlers is well-implemented, with proper formatting of binary message data using String::from_utf8_lossy.

web-transport-quinn/examples/echo-client.rs (2)

26-31: LGTM! Standard tracing initialization.

The initialization follows the established pattern used across all examples.


38-83: Excellent migration with appropriate log levels.

The logging statements are well-structured, and the use of tracing::warn! for the TLS verification warning is particularly appropriate for this security concern. The dependency specification (tracing = "0.1") correctly uses semantic versioning and will resolve to the latest compatible version.

web-transport-quinn/src/session.rs (5)

105-105: LGTM! Informative warning with context.

The structured warning provides both the capsule type and size, which will be helpful for debugging unknown capsule scenarios.


395-395: Proper error logging with debug formatting.

The use of ?err correctly applies Debug formatting to capture the full error details.


415-415: Appropriate log level for ignored streams.

Using debug! level here is correct since ignoring unknown stream types is expected behavior, not an error or warning condition.


466-466: LGTM! Consistent error handling.

The error logging for bidirectional streams follows the same pattern as unidirectional streams, maintaining consistency across the codebase.


493-493: Consistent handling of unknown streams.

The debug logging for unknown bidirectional streams mirrors the unidirectional stream handling, providing consistent logging behavior.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kixelated kixelated merged commit ce0fd3a into main Jan 7, 2026
1 check passed
@kixelated kixelated deleted the tracing branch January 7, 2026 04:39
@github-actions github-actions bot mentioned this pull request Jan 7, 2026
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