+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Conversation

MichaReiser
Copy link
Contributor

Summary

This PR adds the server log to the output of the rage command.

I initially considered implementing the LSP trace notification but preferred to not go with it in the end because:

  • Reading the server log from the disk has the advantage that we can extract log messages that have been written before rage was called compared to only the log messages written when rage rage was run
  • The other approach would probably not have worked because the notifications sent by the LSP server would be send AFTER the rome/rage command has completed. It would be necessary to implement some wait mechanism on the client to give the server time to send the notifications and then consume every one of them.

I still plan to spend some time today to explore if it is possible to implement the trace notification because that can be useful when debugging the VS Code plugin but I no longer plan to use it for the rage command.

Test Plan

I added a new test (that was painful because of race conditions)

image

Open Question

  • Should we include the logs by default or only if a --include-logs argument is present?

@MichaReiser MichaReiser added the A-CLI Area: CLI label Oct 18, 2022
@MichaReiser MichaReiser added this to the 10.0.0 milestone Oct 18, 2022
@MichaReiser MichaReiser requested a review from leops as a code owner October 18, 2022 11:07
@MichaReiser MichaReiser temporarily deployed to netlify-playground October 18, 2022 11:07 Inactive
@MichaReiser MichaReiser force-pushed the feat/rage-server-logs branch from d3e0c5e to 25b5db3 Compare October 18, 2022 11:07
@MichaReiser MichaReiser temporarily deployed to netlify-playground October 18, 2022 11:07 Inactive
@netlify
Copy link

netlify bot commented Oct 18, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit d3e0c5e
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/634e88ef3518890008e98a63

@MichaReiser MichaReiser force-pushed the feat/rage-server-logs branch from 25b5db3 to 3459c3b Compare October 18, 2022 11:08
@MichaReiser MichaReiser temporarily deployed to netlify-playground October 18, 2022 11:08 Inactive
@netlify
Copy link

netlify bot commented Oct 18, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit 2e42fad
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/634e9d8639b0a80008c6f85d

impl<S> Filter<S> for LoggingFilter {
fn enabled(&self, meta: &Metadata<'_>, _cx: &Context<'_, S>) -> bool {
impl LoggingFilter {
fn is_enabled(&self, meta: &Metadata<'_>) -> bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Example implementation from the Filter::enabled documentation for cases where the filter's interest solely depends on the metadata but not on some internal state. source

@github-actions
Copy link

github-actions bot commented Oct 18, 2022

@MichaReiser MichaReiser changed the title feat(rome_cli): Add server logs to rage feat(rome_cli): Add server logs to rage command Oct 18, 2022
@MichaReiser MichaReiser temporarily deployed to netlify-playground October 18, 2022 11:54 Inactive
@MichaReiser MichaReiser temporarily deployed to netlify-playground October 18, 2022 12:29 Inactive
@MichaReiser MichaReiser temporarily deployed to netlify-playground October 18, 2022 12:35 Inactive
@MichaReiser MichaReiser merged commit 1532aad into main Oct 19, 2022
@MichaReiser MichaReiser deleted the feat/rage-server-logs branch October 19, 2022 06:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A-CLI Area: CLI

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载