Skip to content

qlog,quiche,tokio-quiche: add QlogSink abstraction for custom qlogs#2500

Open
strtok wants to merge 1 commit into
cloudflare:masterfrom
strtok:ebremen/qlog
Open

qlog,quiche,tokio-quiche: add QlogSink abstraction for custom qlogs#2500
strtok wants to merge 1 commit into
cloudflare:masterfrom
strtok:ebremen/qlog

Conversation

@strtok
Copy link
Copy Markdown

@strtok strtok commented May 29, 2026

Add a QlogSink trait that allows overriding qlog behavior. Previously QlogStreamer was instantiated with a writer object. Instead, it is instantiated with a QlogSink object which allows more flexibility. A QlogWriterSink implementation provides backwards compatibility.

Implementations have new methods for overriding qlog behavior:

  • Connection::set_qlog_sink and set_qlog_sink_with_level allow setting a custom qlog sink. The existing set_qlog and set_qlog_with_level exist for backwards compatibility and call these new functions with a QlogWriterSink object.
  • A new ConnectionHook::create_qlog_sink hook can be implemented to install a sink at connection accept/connect time. If a sink is returned it overrides any qlog_dir behavior.

Add QlogStreamer::should_log(EventType) that allows high volume events to be skipped without construction. Modified both the recv and write path to make use of this.

…iting

Add a QlogSink trait that allows overriding qlog behavior. Previously
QlogStreamer was instantiated with a writer object. Instead, it is
instantiated with a QlogSink object which allows more flexibility. A
QlogWriterSink implementation provides backwards compatibility.

Implementations have new methods for overriding qlog behavior:
  - Connection::set_qlog_sink and set_qlog_sink_with_level allow setting
    a custom qlog sink. The existing set_qlog and set_qlog_with_level
    exist for backwards compatibility and call these new functions with
    a QlogWriterSink object.
  - A new ConnectionHook::create_qlog_sink hook can be implemented to
    install a sink at connection accept/connect time. If a sink is
    returned it overrides any qlog_dir behavior.

Add QlogStreamer::should_log(EventType) that allows high volume events
to be skipped without construction. Modified both the recv and write
path to make use of this.
@strtok strtok requested a review from a team as a code owner May 29, 2026 19:36
Copy link
Copy Markdown

@meha23 meha23 left a comment

Choose a reason for hiding this comment

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

strtok:ebremen/qlog

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