Skip to content

[Q] Websocket Server to Expose tracing events to other clients (like a javascript client for example) #1958

Answered by hawkw
shekohex asked this question in Q&A
Discussion options

You must be logged in to vote

I don't believe anything like this currently exists, but it's certainly possible to implement. I think you could probably write a simple implementation of this by implementing the MakeWriter trait for a type that writes to a WebSocket connection. This would allow you to forward events logged by the fmt subscriber over WebSockets.

You may want to use the JSON formatter to format those events, so your TypeScript program can make assertions about their structure without having to parse a textual log line.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@shekohex
Comment options

@hawkw
Comment options

Answer selected by shekohex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1956 on February 23, 2022 23:33.