Skip to content

A logging backend that sends some logs to client #2729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eddiemundo opened this issue Feb 21, 2022 · 2 comments
Closed

A logging backend that sends some logs to client #2729

eddiemundo opened this issue Feb 21, 2022 · 2 comments
Labels
type: enhancement New feature or request

Comments

@eddiemundo
Copy link
Collaborator

#2558 (comment)

For future work, we should have a logging backend that forwards some LSP messages (encoded as JSON values) to the LSP stream for testing invariants.

Which I think is related to #2558 (comment)

let eitherFormatOrInit =
          asum
            [ Left
                <$> satisfyLog
                  ( \case
                      KnownTargets.LogGetSigmaTargetsResult {} -> pure ()
                      _ -> empty
                  )
            , Right <$> responseForId STextDocumentFormatting rid
            ]
    res <- skipManyTill anyMessage eitherFormatOrInit
   ...

How I understand this is we want a Recorder that sends some subset of logs to the client by converting them to JSON, sending them using a custom LSP message, then converting them back to the Log type so we can inspect them in client tests.

I'm not certain how exactly the mechanics of choosing log messages to send will work.

@pepeiborra
Copy link
Collaborator

The test chooses which messages get sent, by crafting a priority function

@michaelpj
Copy link
Collaborator

We did this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants