Skip to content

Log raw json-rpc messages #394

Closed Answered by ebkalderon
chioni16 asked this question in Q&A
Jun 22, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hey there! tower-lsp includes built-in integration with tracing for logging. The raw JSON-RPC payloads of both incoming (client-to-server) and outgoing (server-to-client) messages are recorded as trace!() logs here:

trace!("-> {}", msg);

and here:

trace!("<- {}", message);

respectively.

Depending on which tracing subscriber you have set up, you should be able to filter by the "trace" log level emitted from tower_lsp::codec to view the raw messages. For instance, the example programs included in the examples/ directory are set up using the fmt subscriber. To view the ra…

Replies: 1 comment 2 replies

Comment options

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

@ebkalderon
Comment options

Answer selected by chioni16
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