-
Notifications
You must be signed in to change notification settings - Fork 222
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
feat: prqlc compile --debug-log #4646
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks! This direction be really helpful I think.
Not a strong view at all but two other approaches to the logging infra:
- just write structured logs in JSON to stderr / possibly an optional log life
- then have a function to convert to a different representation; e.g. HTML
...that's a bit more modular (though also requires some serialization from serde)
- A specific command like
prqlc debug dump foo.prql
which dumps everything — my guess is that much of the time we'd want to drill down on a specific query, rather than always having some exhaust
...but as above, not a strong view
Actually, this PR is combination of the two things you've suggested.
|
Yes! My musing was whether splitting it up made sense (but really just a musing and maybe not that useful..) |
for more information, see https://pre-commit.ci
I tried this out — really really cool! Very impressive you could pull together a UI so quickly! FWIW when I try I don't get the highlights across the different stages (like in your query) unless I select the whole query, but possibly that's because the spans aren't serialized yet. Other small thoughts (obv you are the owner and so only consider these if they're useful, am strongly not trying to say these are necessarily good)
|
Yes, this is possible to do. We just need to expose the --debug-log argument to JS bindings somehow. We'd probably change the type signature, so the debug log is returned instead of written into a file.
This is easy to do! Newer versions are somewhat easier to parse visually, so it might not even be needed, but yes, can be done. |
Adds a framework for capturing debug information during the compilation process.
First stab at #4636
The result can be serialized into JSON or rendered into HTML (image below). Current display is not much better than plain terminal output, but this has potential for better visualization of what is going on in the compiler.