Skip to content
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

[feature request] Allow RLS logging to file #147

Closed
norru opened this issue Oct 6, 2018 · 12 comments
Closed

[feature request] Allow RLS logging to file #147

norru opened this issue Oct 6, 2018 · 12 comments

Comments

@norru
Copy link
Contributor

norru commented Oct 6, 2018

In a very non-surprising twist of events this is only supported in VSC as it requires a setting to be sent via a LSP client.

https://github.com/rust-lang-nursery/rls/blob/master/debugging.md

Logging

You can also dump to a file by setting rust-client.logToFile to true in the VSCode extension. The file will be in the project root; each time you start the extension, you'll get a new file.

As far as I can understand, this is not the same option that we have now (which logs the LSP4E messages to file).

@norru
Copy link
Contributor Author

norru commented Oct 6, 2018

@mickaelistria

@norru
Copy link
Contributor Author

norru commented Oct 6, 2018

rust-lang/rls#1047

@norru norru changed the title Allow RLS logging to file [feature request] Allow RLS logging to file Nov 4, 2018
@mickaelistria mickaelistria changed the title [feature request] Allow RLS logging to file Allow RLS logging to file Nov 20, 2018
@norru norru changed the title Allow RLS logging to file [feature request] Allow RLS logging to file Nov 20, 2018
@Boereck
Copy link
Contributor

Boereck commented Nov 21, 2018

I was just looking how to get compiler logs to be written in context of a different issue. A quick look at the VS Code sources reveals that the option rust-client.logToFile simply writes the std-err output of the RLS to a file. Error messages that are enabled via the environment variable RUST_LOG are written to std-err.
In LSP4E std-err outputs are written to the language server log. This mixes both regular LSP JSON messages with std-err outputs. For me personally, this is not a big issue, if you care for such separation, please open an issue on the LSP4E project.

@norru
Copy link
Contributor Author

norru commented Nov 21, 2018

stderr in the LSP logs is fine.

Although, if I understand it, the side problem here is that RUST_LOG has to be in the env of Eclipse itself (at least on Unix) and that means either setting the RUST_LOG variable for the entire xsession (which requires a restart of the session to update), starting the IDE from a command line, or creating a separate startup script to be executed from the desktop GUI. Neither of these options is nice - given that the reason for using an IDE is to have an Integrated environment.

Said that, the suggestion is acceptable as a workaround for troubleshooting - just not very user friendly.

@Boereck
Copy link
Contributor

Boereck commented Nov 22, 2018

Yes, there is no configuration to set environment variables for the RLS, they are just inherited from the parent process (which is Eclipse). This could be added in the future, I don't think it is very hard to do.

@mickaelistria
Copy link
Contributor

mickaelistria commented Nov 22, 2018 via email

@norru
Copy link
Contributor Author

norru commented Nov 22, 2018

I agree, as long as all these tricks are documented, it would work for the power users. If demand increases from the community, then the tricks could make their way into features.

@mickaelistria
Copy link
Contributor

@norru would you be interesting in adding such documentation?

@norru
Copy link
Contributor Author

norru commented Nov 23, 2018

@mickaelistria kind of maxed out at the moment. I'll chuck into my todo. I'd be happy to have someone else barge in.

What did you have in mind? A .md file in the repo? A blog post?

@mickaelistria
Copy link
Contributor

mickaelistria commented Nov 23, 2018 via email

@norru
Copy link
Contributor Author

norru commented Dec 1, 2018

#182

@norru norru closed this as completed Dec 5, 2018
@norru
Copy link
Contributor Author

norru commented Dec 14, 2018

@mickaelistria https://github.com/itadinanta/corrosion/blob/feature/troubleshooting_guide/documentation/Troubleshooting.md

It's a draft, very WIP, will send a pull request as soon as it's in a readable state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants