Skip to content

Don't write logs to the dir at cwd by default #282

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
matklad opened this issue Dec 17, 2018 · 5 comments · Fixed by #284
Closed

Don't write logs to the dir at cwd by default #282

matklad opened this issue Dec 17, 2018 · 5 comments · Fixed by #284

Comments

@matklad
Copy link
Member

matklad commented Dec 17, 2018

This writes the logs to the dir at cwd unconditionally. This is useful for development, but can trip new users if the cwd is not writable for some reasons.

Let's add an RA_INTERNAL_MODE env var to control logging behavior. By default we log only to stderr, but with this var set we revert to the current behavior.

@eminence
Copy link
Contributor

Maybe if the envvar is set, it could name a directory into which logs are written?

@matklad
Copy link
Member Author

matklad commented Dec 17, 2018

That would be a possible extension, yeah, but I'd just start with a simple "is var equal to 1" check: I wouldn't use this feature personally, for me the cwd is most convenient.

@DJMcNab
Copy link
Contributor

DJMcNab commented Dec 17, 2018

The cwd is not always clear. For example, the vscode language client seems to be ~ on Ubuntu and $workspaceRoot on windows (your mileage may vary)

@eminence
Copy link
Contributor

On my Windows machine, the cwd is C:\Program Files\Microsoft VS Code

@CAD97
Copy link
Contributor

CAD97 commented Dec 17, 2018

I suppose cwd also depends on whether you launch code from the command line (with code . or code path/to/project) versus using a shortcut (my start menu shortcut is "Start in: "S:\Program Files\Microsoft VS Code"").

TL;DR cwd of a GUI program is messy, and it seems the cwd of the language server inherits that.

bors bot added a commit that referenced this issue Dec 18, 2018
284: By default, log only to stderr, and not to disk. r=matklad a=eminence

This fixes a common problem when running under VS Code, the user doesn't have permissions to create a `log` directory in the CWD.

The old behavior can be re-enabled by setting `RA_INTERNAL_MODE=1`

Fixes #282

Co-authored-by: Andrew Chin <achin@eminence32.net>
@bors bors bot closed this as completed in #284 Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants